mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-05 11:07:55 -05:00
refac
This commit is contained in:
1 parent
47321e0d74
commit
4116a5bffe
16 files changed
+234
-203
No files matched your search
@@ -11,7 +11,7 @@ from contextlib import asynccontextmanager
|
||||
|
||||
import pycrdt as Y
|
||||
from open_webui.env import REDIS_KEY_PREFIX, WEBSOCKET_REDIS_LOCK_TIMEOUT
|
||||
from open_webui.tasks import has_active_tasks
|
||||
from open_webui.runs import has_active_runs
|
||||
from open_webui.utils.json_codec import JSONCodec
|
||||
from open_webui.utils.redis import get_redis_connection
|
||||
from redis.exceptions import RedisClusterException, RedisError
|
||||
@@ -416,7 +416,7 @@ class YdocManager:
|
||||
for document_id in document_ids:
|
||||
async with self.lock(document_id):
|
||||
await self.remove_user(document_id, user_id)
|
||||
if not await self.get_users(document_id) and not await has_active_tasks(self._redis, document_id):
|
||||
if not await self.get_users(document_id) and not await has_active_runs(self._redis, document_id):
|
||||
await self.clear_document(document_id)
|
||||
return list(document_ids)
|
||||
|
||||
|
||||
Reference in new issue
Block a user