forked from platypush/platypush
get_lock
should raise a TimeoutError if lock.acquire
is False
This commit is contained in:
parent
9693becb9e
commit
42d468c895
1 changed files with 2 additions and 0 deletions
|
@ -579,6 +579,8 @@ def get_lock(
|
||||||
result = lock.acquire(**kwargs)
|
result = lock.acquire(**kwargs)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
if not result:
|
||||||
|
raise TimeoutError()
|
||||||
yield result
|
yield result
|
||||||
finally:
|
finally:
|
||||||
if result:
|
if result:
|
||||||
|
|
Loading…
Reference in a new issue