Skip to content

Instantly share code, notes, and snippets.

@jheld
jheld / purge_revoked.py
Last active January 29, 2025 19:41
celery purge revocation control command
from celery.worker.control import control_command
from celery.worker import state as worker_state
@control_command(
args=[('n', float)],
signature='[N=0]', # <- used for help on the command-line.
)
def purge_revoked(state, n=0):