perf(db): deduplicate update_user_last_active_by_id to reduce conflicts

Signed-off-by: Adam Tao <tcx4c70@gmail.com>
This commit is contained in:
Adam Tao
2025-07-07 22:16:19 +08:00
parent b23abcbfe5
commit 635cb8e3ff
3 changed files with 53 additions and 0 deletions

View File

@@ -4,8 +4,10 @@ from typing import Optional
from open_webui.internal.db import Base, JSONField, get_db
from open_webui.env import DATABASE_DEDUPLICATE_INTERVAL
from open_webui.models.chats import Chats
from open_webui.models.groups import Groups
from open_webui.utils.misc import deduplicate
from pydantic import BaseModel, ConfigDict
@@ -311,6 +313,7 @@ class UsersTable:
except Exception:
return None
@deduplicate(DATABASE_DEDUPLICATE_INTERVAL)
def update_user_last_active_by_id(self, id: str) -> Optional[UserModel]:
try:
with get_db() as db: