Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Commit

Permalink
Update lock.py
Browse files Browse the repository at this point in the history
Locks can not be freed after multiple acquire functions are executed in single case mode
  • Loading branch information
MichealCloud authored and dims committed Jun 13, 2018
1 parent 90b7a19 commit 8fccb67
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions etcd3gw/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, name, ttl=DEFAULT_TIMEOUT, client=None):
self.client = client
self.key = LOCK_PREFIX + self.name
self.lease = None
self._uuid = None
self._uuid = str(uuid.uuid1())

@property
def uuid(self):
Expand All @@ -40,7 +40,6 @@ def uuid(self):
def acquire(self):
"""Acquire the lock."""
self.lease = self.client.lease(self.ttl)
self._uuid = str(uuid.uuid1())

base64_key = _encode(self.key)
base64_value = _encode(self._uuid)
Expand Down

0 comments on commit 8fccb67

Please sign in to comment.