mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-10 07:43:10 -05:00
feat: FIX RedisLock REDIS_KEY_PREFIX #6235
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AlbertDoesProgramming on GitHub (Aug 27, 2025).
Check Existing Issues
Problem Description
Previously a feature was added to allow a prefix to be added to keys in redis using the environmental variable: REDIS_KEY_PREFIX
I'm wondering why in open_webui/socket/main.py, the RedisLock doesn't also use the REDIS_KEY_PREFIX.
I'm using ACLs to manage my redis security framework, and I want to gate OWUI access to redis behind access to keys with a certain shape, for example: ~open-webui-1:*. But the prefix isn't added to the name of the the RedisLock, and so when the lock fires, it throws because the key this creates would be out of scope.
Here's the code in question:
Desired Solution you'd like
I would like for the prefix to also be added to the name of the lock:
Alternatives Considered
So there may be good reason for why this has been left the way it is, and I would love to be educated if that's the case! The alternative for my use case, is adding key for the RedisLock to my ACL for the relevant user. But in a shared redis instance with multiple tenants, something about this feels wrong to me.
Additional Context
There's some relevant related issues here:
What spurred me to create this issue was the discussion I contributed to on 16157.
@tjbck commented on GitHub (Aug 27, 2025):
Addressed in dev!
@AlbertDoesProgramming commented on GitHub (Aug 28, 2025):
Thanks everyone, title changed. Appreciate you guys addressing so quickly!