Skip to content

Commit

Permalink
Save only one auth_key on the database again
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Jan 6, 2018
1 parent d81dd05 commit 34fe150
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions telethon/tl/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ def auth_key(self, value):
def _update_session_table(self):
with self._db_lock:
c = self._conn.cursor()
# While we can save multiple rows into the sessions table
# currently we only want to keep ONE as the tables don't
# tell us which auth_key's are usable and will work. Needs
# some more work before being able to save auth_key's for
# multiple DCs. Probably done differently.
c.execute('delete from sessions')
c.execute('insert or replace into sessions values (?,?,?,?)', (
self._dc_id,
self._server_address,
Expand Down

0 comments on commit 34fe150

Please sign in to comment.