mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-08 16:04:51 +00:00
Clear thread lists when stopping. Related to #62
This commit is contained in:
parent
68cd19baa4
commit
33c417942c
2 changed files with 6 additions and 0 deletions
|
|
@ -385,12 +385,16 @@ class Client:
|
||||||
for i in self.updates_workers_list:
|
for i in self.updates_workers_list:
|
||||||
i.join()
|
i.join()
|
||||||
|
|
||||||
|
self.updates_workers_list.clear()
|
||||||
|
|
||||||
for _ in range(self.DOWNLOAD_WORKERS):
|
for _ in range(self.DOWNLOAD_WORKERS):
|
||||||
self.download_queue.put(None)
|
self.download_queue.put(None)
|
||||||
|
|
||||||
for i in self.download_workers_list:
|
for i in self.download_workers_list:
|
||||||
i.join()
|
i.join()
|
||||||
|
|
||||||
|
self.download_workers_list.clear()
|
||||||
|
|
||||||
self.dispatcher.stop()
|
self.dispatcher.stop()
|
||||||
|
|
||||||
self.is_started = False
|
self.is_started = False
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,8 @@ class Dispatcher:
|
||||||
for i in self.workers_list:
|
for i in self.workers_list:
|
||||||
i.join()
|
i.join()
|
||||||
|
|
||||||
|
self.workers_list.clear()
|
||||||
|
|
||||||
def add_handler(self, handler, group: int):
|
def add_handler(self, handler, group: int):
|
||||||
if group not in self.groups:
|
if group not in self.groups:
|
||||||
self.groups[group] = []
|
self.groups[group] = []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue