mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
Don't crash if periodic session access fails
If saving every minute or new entities fails, it's not fatal. Other places are not checked because it is more critical for information to be saved, such as disconnect, where we want to crash if the session cannot be accessed.
This commit is contained in:
@@ -393,7 +393,11 @@ 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.
|
||||
await self.session.save()
|
||||
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)
|
||||
|
||||
async def _dispatch_update(self: 'TelegramClient', update):
|
||||
# TODO only used for AlbumHack, and MessageBox is not really designed for this
|
||||
|
Reference in New Issue
Block a user