mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Clear thread lists when stopping. Related to #62
This commit is contained in:
parent
68cd19baa4
commit
33c417942c
@ -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…
x
Reference in New Issue
Block a user