cron-bundle icon indicating copy to clipboard operation
cron-bundle copied to clipboard

Move calculateNextRun to execute after cron completed. & fixed issues when running multiple instances

Open vigikaran opened this issue 1 year ago • 1 comments

When we running this with multiple instances even though we set maximum instances to > 1 number it always run in single instance. its because if ($job->getNextRun() > $now) This Conditions always rerturn true once the first instance of a cron job started. By moving the calculation of the next run time to the end of the cron job, all instances will execute the main logic first before checking if they should continue running based on the next run time condition. This should allow multiple instances to run concurrently without being blocked by the condition.

vigikaran avatar Mar 27 '24 22:03 vigikaran

Also addressed https://github.com/shapecode/cron-bundle/issues/57

vigikaran avatar Mar 28 '24 11:03 vigikaran