mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
prefix sentinel envs with redis_
This commit is contained in:
@@ -3,12 +3,12 @@ import uuid
|
||||
from open_webui.utils.redis import get_redis_connection
|
||||
|
||||
class RedisLock:
|
||||
def __init__(self, redis_url, lock_name, timeout_secs, sentinels=[]):
|
||||
def __init__(self, redis_url, lock_name, timeout_secs, redis_sentinels=[]):
|
||||
self.lock_name = lock_name
|
||||
self.lock_id = str(uuid.uuid4())
|
||||
self.timeout_secs = timeout_secs
|
||||
self.lock_obtained = False
|
||||
self.redis = get_redis_connection(redis_url, sentinels, decode_responses=True)
|
||||
self.redis = get_redis_connection(redis_url, redis_sentinels, decode_responses=True)
|
||||
|
||||
def aquire_lock(self):
|
||||
# nx=True will only set this key if it _hasn't_ already been set
|
||||
@@ -30,9 +30,9 @@ class RedisLock:
|
||||
|
||||
|
||||
class RedisDict:
|
||||
def __init__(self, name, redis_url, sentinels=[]):
|
||||
def __init__(self, name, redis_url, redis_sentinels=[]):
|
||||
self.name = name
|
||||
self.redis = get_redis_connection(redis_url, sentinels, decode_responses=True)
|
||||
self.redis = get_redis_connection(redis_url, redis_sentinels, decode_responses=True)
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
serialized_value = json.dumps(value)
|
||||
|
||||
Reference in New Issue
Block a user