Periodically save update state (#4071)

This commit is contained in:
Kacnep89
2023-03-28 22:00:36 +05:00
committed by GitHub
parent 0f7756ac68
commit 68ea208b43
2 changed files with 16 additions and 11 deletions

View File

@@ -467,6 +467,8 @@ class UpdateMethods:
# inserted because this is a rather expensive operation
# (default's sqlite3 takes ~0.1s to commit changes). Do
# it every minute instead. No-op if there's nothing new.
self._save_states_and_entities()
self.session.save()
async def _dispatch_update(self: 'TelegramClient', update):