MCPcopy Create free account
hub / github.com/closeio/tasktiger / locked_task

Function locked_task

tests/tasks.py:89–95  ·  view source on GitHub ↗
(key, other=None)

Source from the content-addressed store, hash-verified

87
88@tiger.task(lock=True)
89def locked_task(key, other=None):
90 with redis.Redis(host=REDIS_HOST, db=TEST_DB, decode_responses=True) as conn:
91 data = conn.getset(key, 1)
92 if data is not None:
93 raise Exception("task failed, key already set")
94 time.sleep(DELAY)
95 conn.delete(key)
96
97
98@tiger.task(queue="batch", batch=True)

Callers

nothing calls this directly

Calls 1

deleteMethod · 0.80

Tested by

no test coverage detected