Skip to content

Commit c623d10

Browse files
committed
perf: use asyncio.to_thread for heartbeat DB write
1 parent cfc89b9 commit c623d10

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/open_webui/socket/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ async def heartbeat(sid, data):
393393
user = SESSION_POOL.get(sid)
394394
if user:
395395
SESSION_POOL[sid] = {**user, 'last_seen_at': int(time.time())}
396-
Users.update_last_active_by_id(user['id'])
396+
await asyncio.to_thread(Users.update_last_active_by_id, user['id'])
397397

398398

399399
@sio.on('join-channels')

0 commit comments

Comments
 (0)