mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 13:14:31 +03:00
Fix setting None update workers not causing all threads to stop
This commit is contained in:
parent
8c3c990e74
commit
f1bca0fd06
|
@ -79,9 +79,12 @@ class UpdateState:
|
||||||
"""Raises "StopIterationException" on the worker threads to stop them,
|
"""Raises "StopIterationException" on the worker threads to stop them,
|
||||||
and also clears all of them off the list
|
and also clears all of them off the list
|
||||||
"""
|
"""
|
||||||
|
if self._workers:
|
||||||
with self._updates_lock:
|
with self._updates_lock:
|
||||||
# Insert at the beginning so the very next poll causes an error
|
# Insert at the beginning so the very next poll causes an error
|
||||||
|
# on all the worker threads
|
||||||
# TODO Should this reset the pts and such?
|
# TODO Should this reset the pts and such?
|
||||||
|
for _ in range(self._workers):
|
||||||
self._updates.appendleft(StopIteration())
|
self._updates.appendleft(StopIteration())
|
||||||
self._updates_available.set()
|
self._updates_available.set()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user