Improved date time formula thing.
This commit is contained in:
parent
d70a20a466
commit
70c31a6149
|
@ -32,7 +32,7 @@ class Queue
|
||||||
|
|
||||||
// Calculate the delay until the next trial
|
// Calculate the delay until the next trial
|
||||||
$delay = (($retrial + 3) ** 4) + (rand(1, 30) * ($retrial + 1));
|
$delay = (($retrial + 3) ** 4) + (rand(1, 30) * ($retrial + 1));
|
||||||
$next = DateTimeFormat::utc(date('c', time() + $delay));
|
$next = DateTimeFormat::utc('now ' . $delay . ' seconds');
|
||||||
|
|
||||||
dba::update('queue', ['last' => DateTimeFormat::utcNow(), 'retrial' => $retrial + 1, 'next' => $next], ['id' => $id]);
|
dba::update('queue', ['last' => DateTimeFormat::utcNow(), 'retrial' => $retrial + 1, 'next' => $next], ['id' => $id]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user