This commit is contained in:
AKW 2023-12-29 16:02:26 +08:00
parent b9863631bd
commit e3bfed8a2e
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ class SimpleLock(ILock):
def __init__(self, name: str, alias: str = "default") -> None:
self.name = name
self.redis_con = get_redis_connection(alias)
self.key = f"{self.KEY_PREFIX}{self.ID_PREFIX}"
self.key = f"{self.KEY_PREFIX}{name}{self.ID_PREFIX}"
def try_lock(self, timeout: int) -> bool:
current_thread_id, value = self.get_value()