There is a library called celery_once. The mechanism behind it is to set a task lock with the task name in redis. When a task is being executed, the same task cannot be triggered again.
When a task is triggered, if it is found that the task already has a lock, an AlreadyQueued exception will be thrown, which is very suitable for use when the previous task has not been executed, the next cycle has arrived, and the mutual exclusion of scheduled tasks in the case of distributed task services scene.
https://pypi.python.org/pypi/...
There is a library called celery_once. The mechanism behind it is to set a task lock with the task name in redis. When a task is being executed, the same task cannot be triggered again.
When a task is triggered, if it is found that the task already has a lock, an AlreadyQueued exception will be thrown, which is very suitable for use when the previous task has not been executed, the next cycle has arrived, and the mutual exclusion of scheduled tasks in the case of distributed task services scene.
Hope it’s useful to you.