Revert "Make sessions async"

This reverts commit d2de0f3aca.
This commit is contained in:
Lonami Exo
2022-08-30 12:32:21 +02:00
parent 88b2b9372d
commit 7d21b40401
9 changed files with 78 additions and 61 deletions

View File

@@ -397,11 +397,7 @@ 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.
try:
await self.session.save()
except OSError as e:
# No big deal if this cannot be immediately saved
self._log[__name__].warning('Could not perform the periodic save of session data: %s: %s', type(e), e)
self.session.save()
async def _dispatch_update(self: 'TelegramClient', update):
# TODO only used for AlbumHack, and MessageBox is not really designed for this