I think a periodic task should not repeat till current job is completed. But other workers are starting the task even when job is not yet completed in another worker.
Example scenario:
Lets say I want to write a periodic task that makes payments every 60 seconds to users who requested withdraw. Lets say it took 2 min to do some process but payments not yet made so those payment requests are still in pending. But if another worker picks up before other one completes it (or marks payment request as done), then payments will go twice.
So, is there any existing solution here? Or do I need to customise it somehow?
Possible solutions:
Inside the task being executed, loop over all workers and check if the job related to that task is current job of any worker? If yes, just return it so it can run in next schedule.
But I think it will be better to have this feature. If possible, please add it.
I think a periodic task should not repeat till current job is completed. But other workers are starting the task even when job is not yet completed in another worker.
Example scenario:
Lets say I want to write a periodic task that makes payments every 60 seconds to users who requested withdraw. Lets say it took 2 min to do some process but payments not yet made so those payment requests are still in pending. But if another worker picks up before other one completes it (or marks payment request as done), then payments will go twice.
So, is there any existing solution here? Or do I need to customise it somehow?
Possible solutions:
Inside the task being executed, loop over all workers and check if the job related to that task is current job of any worker? If yes, just return it so it can run in next schedule.
But I think it will be better to have this feature. If possible, please add it.
Thanks