MCPcopy
hub / github.com/celery/celery / _app_or_default_trace

Function _app_or_default_trace

celery/_state.py:163–179  ·  view source on GitHub ↗
(app=None)

Source from the content-addressed store, hash-verified

161
162
163def _app_or_default_trace(app=None): # pragma: no cover
164 from traceback import print_stack
165 try:
166 from billiard.process import current_process
167 except ImportError:
168 current_process = None
169 if app is None:
170 if getattr(_tls, 'current_app', None):
171 print('-- RETURNING TO CURRENT APP --') # +
172 print_stack()
173 return _tls.current_app
174 if not current_process or current_process()._name == 'MainProcess':
175 raise Exception('DEFAULT APP')
176 print('-- RETURNING TO DEFAULT APP --') # +
177 print_stack()
178 return default_app
179 return app
180
181
182def enable_trace():

Callers

nothing calls this directly

Calls 1

current_processFunction · 0.85

Tested by

no test coverage detected