Show More
@@ -323,11 +323,8 b' def get_mutex_lock(client, lock_key, loc' | |||
|
323 | 323 | class _RedisLockWrapper(object): |
|
324 | 324 | """LockWrapper for redis_lock""" |
|
325 | 325 | |
|
326 | def __init__(self): | |
|
327 | pass | |
|
328 | ||
|
329 | @property | |
|
330 | def lock(self): | |
|
326 | @classmethod | |
|
327 | def get_lock(cls): | |
|
331 | 328 | return redis_lock.Lock( |
|
332 | 329 | redis_client=client, |
|
333 | 330 | name=lock_key, |
@@ -336,8 +333,14 b' def get_mutex_lock(client, lock_key, loc' | |||
|
336 | 333 | strict=True, |
|
337 | 334 | ) |
|
338 | 335 | |
|
336 | def __init__(self): | |
|
337 | self.lock = self.get_lock() | |
|
338 | ||
|
339 | 339 | def acquire(self, wait=True): |
|
340 | try: | |
|
340 | 341 | return self.lock.acquire(wait) |
|
342 | except redis_lock.AlreadyAquited: | |
|
343 | return False | |
|
341 | 344 | |
|
342 | 345 | def release(self): |
|
343 | 346 | try: |
General Comments 0
You need to be logged in to leave comments.
Login now