标签归档:celery

celery的超时和kill引起的异常

1)终止进程引起的错误:
WorkerLostError:

.

2 超时引起的错误
SoftTimeLimitExceeded

celery的异常文件中 celery.exceptions有以上个异常的定义

celery的options中expires

CELERYBEAT_SCHEDULE: In each task, you can add an ‘options’ dictionary and set ‘expires’ to a number of seconds. If the task doesn’t run within that time, it’ll be discarded rather than run when it finally gets to a worker. This can help a lot with periodic tasks when workers or the queue gets hung up for a while and then unjammed – without this, the workers will have to work through a huge backlog of the same periodic tasks over and over, for no reason.

Example: