perf: use asyncio.to_thread for heartbeat DB write (#22980)

This commit is contained in:
Algorithm5838
2026-03-24 04:48:06 -05:00
committed by GitHub
parent 139e764b2f
commit f0d48a4295
+1 -1
View File
@@ -393,7 +393,7 @@ async def heartbeat(sid, data):
user = SESSION_POOL.get(sid)
if user:
SESSION_POOL[sid] = {**user, 'last_seen_at': int(time.time())}
Users.update_last_active_by_id(user['id'])
await asyncio.to_thread(Users.update_last_active_by_id, user['id'])
@sio.on('join-channels')