mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-28 04:13:45 +03:00
Change updates add_done_callback to discard tasks more reliably
See #3235. This should help tone down memory usage a little.
This commit is contained in:
parent
b2925f8279
commit
5080715565
|
@ -271,7 +271,7 @@ class UpdateMethods:
|
||||||
# TODO if _dispatch_update fails for whatever reason, it's not logged! this should be fixed
|
# TODO if _dispatch_update fails for whatever reason, it's not logged! this should be fixed
|
||||||
task = self.loop.create_task(self._dispatch_update(updates_to_dispatch.popleft()))
|
task = self.loop.create_task(self._dispatch_update(updates_to_dispatch.popleft()))
|
||||||
self._event_handler_tasks.add(task)
|
self._event_handler_tasks.add(task)
|
||||||
task.add_done_callback(lambda _: self._event_handler_tasks.discard(task))
|
task.add_done_callback(self._event_handler_tasks.discard)
|
||||||
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user