MCPcopy
hub / github.com/celery/celery / acquire

Method acquire

celery/platforms.py:143–149  ·  view source on GitHub ↗

Acquire lock.

(self)

Source from the content-addressed store, hash-verified

141 self.path = os.path.abspath(path)
142
143 def acquire(self):
144 """Acquire lock."""
145 try:
146 self.write_pid()
147 except OSError as exc:
148 reraise(LockFailed, LockFailed(str(exc)), sys.exc_info()[2])
149 return self
150
151 __enter__ = acquire
152

Callers 10

_create_pidlockFunction · 0.95
test_on_task_callMethod · 0.80
test_accept_contentMethod · 0.80
test_setup_nolimitMethod · 0.80
test_setupMethod · 0.80
store_resultMethod · 0.80
_get_connectionMethod · 0.80
default_dispatcherMethod · 0.80
_acquire_connectionMethod · 0.80

Calls 3

write_pidMethod · 0.95
reraiseFunction · 0.85
LockFailedClass · 0.85

Tested by 5

test_on_task_callMethod · 0.64
test_accept_contentMethod · 0.64
test_setup_nolimitMethod · 0.64
test_setupMethod · 0.64