Temporary fix for transaction issues.

This commit is contained in:
2025-09-02 08:57:26 +10:00
parent 38ba997dbe
commit ce07a1e89e
3 changed files with 11 additions and 13 deletions

View File

@@ -178,9 +178,7 @@ class Bot(commands.Bot):
# Save the token and scopes to data
# Wrap this in a transaction so if it fails halfway we rollback correctly
async with self.dbconn.connection() as conn:
self.dbconn.conn = conn
async with conn.transaction():
# TODO
row = await UserAuth.fetch_or_create(userid, token=token, refresh_token=refresh)
if row.token != token or row.refresh_token != refresh:
await row.update(token=token, refresh_token=refresh)