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

Method flush_locks

huey/api.py:771–783  ·  view source on GitHub ↗
(self, *names)

Source from the content-addressed store, hash-verified

769 return TaskLock(self, lock_name).is_locked()
770
771 def flush_locks(self, *names):
772 flushed = set()
773 locks = self._locks
774 if names:
775 lock_template = '%s.lock.%%s' % self.name
776 named_locks = (lock_template % name.strip() for name in names)
777 locks = itertools.chain(locks, named_locks)
778
779 for lock_key in locks:
780 if self.delete(lock_key):
781 flushed.add(lock_key.split('.lock.', 1)[-1])
782
783 return flushed
784
785 def rate_limit(self, name, limit, per, retry=True):
786 return RateLimit(self, name, limit, per, retry=retry)

Callers 2

test_flush_locksMethod · 0.45

Calls 2

deleteMethod · 0.95
addMethod · 0.45

Tested by 2

test_flush_locksMethod · 0.36