简体   繁体   中英

How to set a time limit to a task if not excute within a certain time then just remove it in celery

I'm using celery(rabbitmq as broker) to do many tasks every minute.Since the task is a little time-consuming, the tasks in the queue may accumulate which leads to the newest come task not excute in time. How can I deal with it?

I think I find it in the document:

Expiration

add.apply_async(args=[10, 10], expires=60)

Task Expires

@task(expires=50)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM