MCPcopy
hub / github.com/celery/celery / finalize

Method finalize

celery/app/base.py:653–673  ·  view source on GitHub ↗

Finalize the app. This loads built-in tasks, evaluates pending task decorators, reads configuration, etc.

(self, auto=False)

Source from the content-addressed store, hash-verified

651 return gen_task_name(self, name, module)
652
653 def finalize(self, auto=False):
654 """Finalize the app.
655
656 This loads built-in tasks, evaluates pending task decorators,
657 reads configuration, etc.
658 """
659 with self._finalize_mutex:
660 if not self.finalized:
661 if auto and not self.autofinalize:
662 raise RuntimeError('Contract breach: app not finalized')
663 self.finalized = True
664 _announce_app_finalized(self)
665
666 pending = self._pending
667 while pending:
668 maybe_evaluate(pending.popleft())
669
670 for task in self._tasks.values():
671 task.bind(self)
672
673 self.on_after_finalize.send(sender=self)
674
675 def add_defaults(self, fun):
676 """Add default configuration from dict ``d``.

Callers 7

tasksMethod · 0.95
apply_asyncMethod · 0.45
setup_app_for_workerFunction · 0.45
_connect_signalMethod · 0.45
init_loaderMethod · 0.45
process_initializerFunction · 0.45

Calls 4

_announce_app_finalizedFunction · 0.90
maybe_evaluateFunction · 0.90
bindMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected