Skip to content

Commit

Permalink
Don't hold ._updates_lock while calling .handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Sep 18, 2017
1 parent 143e046 commit 0235fce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions telethon/update_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ def process(self, update):
self._state = update
elif not hasattr(update, 'pts') or update.pts > self._state.pts:
self._state.pts = getattr(update, 'pts', self._state.pts)
for handler in self.handlers:
handler(update)

if self._polling:
self._updates.append(update)
self._updates_available.set()

for handler in self.handlers:
handler(update)

0 comments on commit 0235fce

Please sign in to comment.