From 88b2b9372d7857620b48a408266b35e89d4ff70b Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Tue, 30 Aug 2022 12:22:05 +0200 Subject: [PATCH] Revert "Mark certain SQLiteSession methods as async" This reverts commit f913ea6b75e4881782ebc15f08fbc996a94a72eb. --- telethon/sessions/sqlite.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/telethon/sessions/sqlite.py b/telethon/sessions/sqlite.py index dff73df3..f687080a 100644 --- a/telethon/sessions/sqlite.py +++ b/telethon/sessions/sqlite.py @@ -201,7 +201,7 @@ class SQLiteSession(MemorySession): )) c.close() - async def get_update_state(self, entity_id): + def get_update_state(self, entity_id): row = self._execute('select pts, qts, date, seq from update_state ' 'where id = ?', entity_id) if row: @@ -210,7 +210,7 @@ class SQLiteSession(MemorySession): date, tz=datetime.timezone.utc) return types.updates.State(pts, qts, date, seq, unread_count=0) - async def set_update_state(self, entity_id, state): + def set_update_state(self, entity_id, state): self._execute('insert or replace into update_state values (?,?,?,?,?)', entity_id, state.pts, state.qts, state.date.timestamp(), state.seq) @@ -229,7 +229,7 @@ class SQLiteSession(MemorySession): finally: c.close() - async def save(self): + def save(self): """Saves the current session object as session_user_id.session""" # This is a no-op if there are no changes to commit, so there's # no need for us to keep track of an "unsaved changes" variable. @@ -254,7 +254,7 @@ class SQLiteSession(MemorySession): finally: c.close() - async def close(self): + def close(self): """Closes the connection unless we're working in-memory""" if self.filename != ':memory:': if self._conn is not None: @@ -262,7 +262,7 @@ class SQLiteSession(MemorySession): self._conn.close() self._conn = None - async def delete(self): + def delete(self): """Deletes the current session file""" if self.filename == ':memory:': return True @@ -282,7 +282,7 @@ class SQLiteSession(MemorySession): # Entity processing - async def process_entities(self, tlo): + def process_entities(self, tlo): """ Processes all the found entities on the given TLObject, unless .save_entities is False.