Skip to content

Commit

Permalink
Merge pull request #7 from callebtc/threads-daemon
Browse files Browse the repository at this point in the history
threads are daemon mode
  • Loading branch information
callebtc authored Feb 25, 2023
2 parents 2872fe3 + 1f5c6f6 commit 59ddc1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def callback(event: Event, decrypted_content):
print(f"Your public key: {client.public_key.bech32()}")

t = threading.Thread(
target=client.get_dm,
args=(client.public_key, callback),
target=client.get_dm, args=(client.public_key, callback), daemon=True
)
t.start()

Expand Down Expand Up @@ -100,6 +99,7 @@ def callback(event: Event):
callback,
filters,
),
daemon=True,
)
t.start()

Expand Down
4 changes: 2 additions & 2 deletions nostr/relay_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def open_connections(self, ssl_options: dict = None, proxy: dict = None):
target=relay.connect,
args=(ssl_options, proxy),
name=f"{relay.url}-thread",
daemon=True,
).start()

threading.Thread(
target=relay.queue_worker,
name=f"{relay.url}-queue",
target=relay.queue_worker, name=f"{relay.url}-queue", daemon=True
).start()

def close_connections(self):
Expand Down

0 comments on commit 59ddc1b

Please sign in to comment.