cron-bundle
cron-bundle copied to clipboard
Move calculateNextRun to execute after cron completed. & fixed issues when running multiple instances
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.
Also addressed https://github.com/shapecode/cron-bundle/issues/57