You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
bhaskar8088
changed the title
Don't repeat periodic task till its completed
Don't repeat periodic task till its completed by other workers
Apr 29, 2021
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
The text was updated successfully, but these errors were encountered: