mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 19:37:47 +01:00
Fix: Use SCAN instead of KEYS for Redis cluster compatibility (#19871)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user