Nextrun rescheduled
This commit is contained in:
parent
0a664a8a76
commit
3c75f7c9d4
|
@ -96,8 +96,11 @@ foreach ($results as $result) {
|
|||
$stmt = $db->prepare("INSERT INTO runs(job, statuscode, result, timestamp) VALUES(?, ?, ?, ?)");
|
||||
$stmt->execute(array($result['jobID'], $statuscode, $body, time()));
|
||||
}
|
||||
$nextrun = $result['nextrun'] + $result['delay'];
|
||||
if ($nextrun < time() ) { $nextrun = time() + $result['delay']; }
|
||||
|
||||
$nextrun = $result['nextrun'];
|
||||
do {
|
||||
$nextrun = $nextrun + $result['delay'];
|
||||
} while ($nextrun < time())
|
||||
|
||||
$nexttime = $db->prepare("UPDATE jobs SET nextrun = ? WHERE jobID = ?");
|
||||
$nexttime->execute(array($nextrun, $result["jobID"]));
|
||||
|
|
Loading…
Reference in New Issue
Block a user