mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
Fix: Use SCAN instead of KEYS for Redis cluster compatibility
This commit is contained in:
parent
3b3e12b43a
commit
a161bff3ef
1 changed files with 3 additions and 1 deletions
|
|
@ -190,7 +190,9 @@ class YdocManager:
|
|||
|
||||
async def remove_user_from_all_documents(self, user_id: str):
|
||||
if self._redis:
|
||||
keys = await self._redis.keys(f"{self._redis_key_prefix}:*")
|
||||
keys = []
|
||||
async for key in self._redis.scan_iter(match=f"{self._redis_key_prefix}:*", count=100):
|
||||
keys.append(key)
|
||||
for key in keys:
|
||||
if key.endswith(":users"):
|
||||
await self._redis.srem(key, user_id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue