MCPcopy Create free account
hub / github.com/coleifer/huey / acquire

Method acquire

huey/api.py:1084–1087  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1082 self._huey.delete(self._key)
1083
1084 def acquire(self):
1085 if not self._huey.put_if_empty(self._key, '1'):
1086 raise TaskLockedException('unable to acquire lock %s' % self._name)
1087 return True
1088
1089 def clear(self):
1090 return self._huey.delete(self._key)

Callers 1

__enter__Method · 0.95

Calls 2

TaskLockedExceptionClass · 0.90
put_if_emptyMethod · 0.45

Tested by

no test coverage detected