0
votes

I'm working on celery schedule tasks and got a problem.

suppose there is a schedule task that runs in every 5 minutes.

and this task can be manually executed in some of my API,

and I always want the intervals of this task is 5 minutes.

for example, if this task auto executed at 8:00,

and at 8:01 I executed this task a second time,

now I want the next time Celery auto run this time at 8:06.

so is there any way to do that in Celery?

1

1 Answers

0
votes

No. It does not. Celery beat (scheduler) will run the task every 5 minutes. If you manually trigger a task, it will be executed and possibly for some time run in parallel with task(s) executed by scheduler.

What you can do though is, by using a distributed lock, to prevent tasks running in parallel, if that is something you need.

Alternatively, you can write your own scheduler that has this functionality.