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

Function hello

celery/worker/control.py:404–420  ·  view source on GitHub ↗

Request mingle sync-data.

(state, from_node, revoked=None, **kwargs)

Source from the content-addressed store, hash-verified

402
403@inspect_command(visible=False)
404def hello(state, from_node, revoked=None, **kwargs):
405 """Request mingle sync-data."""
406 # pylint: disable=redefined-outer-name
407 # XXX Note that this redefines `revoked`:
408 # Outside of this scope that is a function.
409 if from_node != state.hostname:
410 logger.info('sync with %s', from_node)
411 if revoked:
412 worker_state.merge_revoked(revoked)
413 # Do not send expired items to the other worker.
414 worker_state.revoked.purge()
415 return {
416 # The ids only, see merge_revoked(): oldest first, so that
417 # a receiver whose set is full evicts our oldest ids first.
418 'revoked': list(worker_state.revoked),
419 'clock': state.app.clock.forward(),
420 }
421
422
423@inspect_command(default_timeout=0.2)

Callers

nothing calls this directly

Calls 2

infoMethod · 0.45
purgeMethod · 0.45

Tested by

no test coverage detected