We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6407b6 commit 1a29afaCopy full SHA for 1a29afa
1 file changed
etcd3/locks.py
@@ -2,7 +2,7 @@
2
import time
3
import uuid
4
5
-from etcd3 import events
+from etcd3 import events, exceptions
6
7
8
class Lock(object):
@@ -94,8 +94,11 @@ def _try_acquire(self):
94
return False
95
96
def _wait_delete_event(self, timeout):
97
- event_iter, cancel = self.etcd_client.watch(
98
- self.key, start_revision=self.revision + 1)
+ try:
+ event_iter, cancel = self.etcd_client.watch(
99
+ self.key, start_revision=self.revision + 1)
100
+ except exceptions.WatchTimedOut:
101
+ return
102
103
if timeout is not None:
104
timer = threading.Timer(timeout, cancel)
0 commit comments