refactor: move stop logic
This commit is contained in:
parent
4238be498f
commit
c0632cabe5
2 changed files with 10 additions and 6 deletions
11
services.py
11
services.py
|
|
@ -68,7 +68,16 @@ class NostrRouter:
|
|||
|
||||
async def stop(self):
|
||||
for t in self.tasks:
|
||||
t.cancel()
|
||||
try:
|
||||
t.cancel()
|
||||
except:
|
||||
pass
|
||||
|
||||
for s in self.subscriptions:
|
||||
try:
|
||||
nostr.client.relay_manager.close_subscription(s)
|
||||
except:
|
||||
pass
|
||||
self.connected = False
|
||||
|
||||
async def _handle_subscriptions(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue