mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-11 22:52:54 +00:00
Fix: Use SCAN instead of KEYS for Redis cluster compatibility (#19871)
This commit is contained in:
parent
379f888c9d
commit
8e661a4e73
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…
Add table
Reference in a new issue