mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
refactor(config): SIGNAL_CACHE_CONFIG → DISTRIBUTED_COORDINATION_CONFIG (#38395)
This commit is contained in:
committed by
GitHub
parent
832fee3ff8
commit
19f949276c
@@ -46,7 +46,7 @@ class AcquireDistributedLock(BaseDistributedLockCommand):
|
||||
"""
|
||||
Acquire a distributed lock with automatic backend selection.
|
||||
|
||||
Uses Redis SET NX EX when SIGNAL_CACHE_CONFIG is configured,
|
||||
Uses Redis SET NX EX when DISTRIBUTED_COORDINATION_CONFIG is configured,
|
||||
otherwise falls back to KeyValue table.
|
||||
|
||||
Raises AcquireDistributedLockFailedException if:
|
||||
|
||||
@@ -41,12 +41,12 @@ def get_default_lock_ttl() -> int:
|
||||
|
||||
def get_redis_client() -> "redis.Redis[Any] | None":
|
||||
"""
|
||||
Get Redis client from signal cache if available.
|
||||
Get Redis client from distributed coordination if available.
|
||||
|
||||
Returns None if SIGNAL_CACHE_CONFIG is not configured,
|
||||
Returns None if DISTRIBUTED_COORDINATION_CONFIG is not configured,
|
||||
allowing fallback to database-backed locking.
|
||||
"""
|
||||
backend = cache_manager.signal_cache
|
||||
backend = cache_manager.distributed_coordination
|
||||
return backend._cache if backend else None
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class ReleaseDistributedLock(BaseDistributedLockCommand):
|
||||
"""
|
||||
Release a distributed lock with automatic backend selection.
|
||||
|
||||
Uses Redis DELETE when SIGNAL_CACHE_CONFIG is configured,
|
||||
Uses Redis DELETE when DISTRIBUTED_COORDINATION_CONFIG is configured,
|
||||
otherwise deletes from KeyValue table.
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user