MCPcopy
hub / github.com/celery/celery / status

Function status

celery/bin/control.py:129–150  ·  view source on GitHub ↗

Show list of workers that are online.

(ctx, timeout, destination, json, **kwargs)

Source from the content-addressed store, hash-verified

127@click.pass_context
128@handle_preload_options
129def status(ctx, timeout, destination, json, **kwargs):
130 """Show list of workers that are online."""
131 callback = None if json else partial(_say_remote_command_reply, ctx)
132 try:
133 replies = ctx.obj.app.control.inspect(timeout=timeout,
134 destination=destination,
135 callback=callback).ping()
136 except Exception as exc:
137 handle_remote_command_error('status', exc)
138
139 if not replies:
140 raise CeleryCommandException(
141 message='No nodes replied within time constraint',
142 exit_code=EX_UNAVAILABLE
143 )
144
145 if json:
146 ctx.obj.echo(dumps(replies))
147 nodecount = len(replies)
148 if not kwargs.get('quiet', False):
149 ctx.obj.echo('\n{} {} online.'.format(
150 nodecount, text.pluralize(nodecount, 'node')))
151
152
153@click.command(cls=CeleryCommand,

Callers

nothing calls this directly

Calls 7

echoMethod · 0.80
pingMethod · 0.45
inspectMethod · 0.45
getMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected