forked from LBRYCommunity/lbry-sdk
stop tracker tasks on shutdown
This commit is contained in:
parent
47e432b4bb
commit
42fd1c962e
2 changed files with 4 additions and 1 deletions
|
@ -750,3 +750,4 @@ class TrackerAnnouncerComponent(Component):
|
|||
if self.announce_task and not self.announce_task.done():
|
||||
self.announce_task.cancel()
|
||||
self.announce_task = None
|
||||
self.tracker_client.stop()
|
||||
|
|
|
@ -5,7 +5,7 @@ import logging
|
|||
import time
|
||||
from collections import namedtuple
|
||||
|
||||
from lbry.utils import resolve_host, async_timed_cache
|
||||
from lbry.utils import resolve_host, async_timed_cache, cancel_tasks
|
||||
from lbry.wallet.stream import StreamController
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -145,6 +145,8 @@ class TrackerClient:
|
|||
self.client = None
|
||||
self.transport = None
|
||||
self.EVENT_CONTROLLER.close()
|
||||
cancel_tasks([task for _, task in self.tasks])
|
||||
self.tasks.clear()
|
||||
|
||||
def hash_done(self, info_hash):
|
||||
self.announced += 1
|
||||
|
|
Loading…
Reference in a new issue