From 5c843c18eb078b2584bf22cd4c91178815794958 Mon Sep 17 00:00:00 2001 From: Tracker-Friendly Date: Sat, 30 Mar 2024 19:53:07 +0000 Subject: [PATCH] Wait in the right place --- main | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main b/main index 667a443..c2c9207 100644 --- a/main +++ b/main @@ -75,6 +75,7 @@ def check_username_taken(username): async def oauth2_token_refresh(openid, appId): while True: + await asyncio.sleep(3600) conn = get_db_connection() # Fetch required data in a single query @@ -102,7 +103,6 @@ async def oauth2_token_refresh(openid, appId): conn.execute("UPDATE logins SET code = ?, nextcode = ?, secret = ?, nextsecret = ?, openid = ?, nextopenid = ? WHERE appId = ? AND openid = ?", (nextcode, str(secrets.token_hex(512)), nextsecret, str(secrets.token_hex(512)), nextopenid, str(jwt_token), str(appId), str(openid))) conn.commit() conn.close() - await asyncio.sleep(3600) else: conn.close() return