()
Kills all celery workers and starts new ones.
Kills all celery workers and starts new ones.
Kills all celery workers and starts new ones .
def restart_celery() -> None:
    """Kills all celery workers and starts new ones."""
    subprocess.call(["pkill", "-9", "-f", "celery -A core"])

    # https://docs.celeryproject.org/en/stable/userguide/tasks.html
    # use -O fair to be friendly to long-running tasks
    subprocess.call("celery -A core worker -O fair -l INFO".split())
def restart_celery ( ) -> None : subprocess . call ( [ "pkill" , "-9" , "-f" , "celery -A core" ] ) # https://docs.celeryproject.org/en/stable/userguide/tasks.html # use -O fair to be friendly to long-running tasks subprocess . call ( "celery -A core worker -O fair -l INFO" . split ( ) )