php Cron Job issue.
Budget: $10 – $30 USD
we have 2 scripts works with cron ,one is every minute and the other works once a day .
the one which works only once I day is pretty heavy ,while the other one is not .
the one which is working every minute works without any issues , till the other one started then the execution time of the one that works every minute will be achieved while it is still processing the data which will lead into data lose .
we need to fix the one to keep working and finish what the script started even if the execution time achieved so we won't lose any data
our code is simple
set_time_limit(60);
for ($i = 0; $i < 59; ++$i) {
$this->doStuff();
sleep(1);
}
the one which works only once I day is pretty heavy ,while the other one is not .
the one which is working every minute works without any issues , till the other one started then the execution time of the one that works every minute will be achieved while it is still processing the data which will lead into data lose .
we need to fix the one to keep working and finish what the script started even if the execution time achieved so we won't lose any data
our code is simple
set_time_limit(60);
for ($i = 0; $i < 59; ++$i) {
$this->doStuff();
sleep(1);
}