Closed playinteractive closed 6 years ago
@playinteractive the second block of code is the correct, you might need to call resetRun
only if you want the same job to run multiple times in the same schedule.
Example
$scheduler->php('job1.php');
$scheduler->php('job2.php');
$scheduler->run();
// Then you want job1 to run again in the same schedule
$scheduler->resetRun();
$scheduler->php('job1');
$scheduler->run();
@peppeocchi
For clarity, I have the following wrapped in a function which is called by scheduler.php
$scheduler = new Scheduler();
$jobs = $db->querry;
foreach ( $jobs as $job ) {
$job[1] = $function;
$job[2] = $schedule;
$scheduler->call($function)->at($schedule)->onlyOne();
}
$scheduler->run();
In this instance there is no need to use either clearJobs()
or resetRun()
when calling this every minute, yes?
Hi there,
I'm reading a list of cronjobs from the database but I'm not sure how to use resetRun():
or maybe:
Many thanks,