MCPcopy Create free account
hub / github.com/celery/celery / DaemonOption

Class DaemonOption

celery/bin/base.py:265–279  ·  view source on GitHub ↗

Common daemonization option

Source from the content-addressed store, hash-verified

263
264
265class DaemonOption(CeleryOption):
266 """Common daemonization option"""
267
268 def __init__(self, *args, **kwargs):
269 super().__init__(args,
270 help_group=kwargs.pop("help_group", "Daemonization Options"),
271 callback=kwargs.pop("callback", self.daemon_setting),
272 **kwargs)
273
274 def daemon_setting(self, ctx: Context, opt: CeleryOption, value: Any) -> Any:
275 """
276 Try to fetch daemonization option from applications settings.
277 Use the daemon command name as prefix (eg. `worker` -> `worker_pidfile`)
278 """
279 return value or getattr(ctx.obj.app.conf, f"{ctx.command.name}_{self.name}", None)
280
281
282class CeleryDaemonCommand(CeleryCommand):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected