celery trying shutdown worker by raising SystemExit in task_postrun signal but always hangs and the main process never exits
问题 I'm trying to shutdown the main celery process by raisin SystemExit() in the task_postrun signal. The signal gets fired just fine, and the exception gets raised, but the worker never completely exits and just hangs there. HOW DO I MAKE THIS WORK? Am I forgetting some setting somewhere? Below is the code that I'm using for the worker (worker.py): from celery import Celery from celery import signals app = Celery('tasks', set_as_current = True, broker='amqp://guest@localhost//', backend="mongodb