increase timespan between each retry
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
parent
d4134982f5
commit
f6b0a65c5a
|
@ -36,8 +36,8 @@ class RetryJob extends Job {
|
||||||
private $jobList;
|
private $jobList;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
private $lookupServer;
|
private $lookupServer;
|
||||||
/** @var int how much time should be between two tries (10 minutes) */
|
/** @var int how much time should be between two, will be increased for each retry */
|
||||||
private $interval = 600;
|
private $interval = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param IClientService $clientService
|
* @param IClientService $clientService
|
||||||
|
@ -108,7 +108,9 @@ class RetryJob extends Job {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function shouldRun($argument) {
|
protected function shouldRun($argument) {
|
||||||
return !isset($argument['lastRun']) || ((time() - $argument['lastRun']) > $this->interval);
|
$retryNo = (int)$argument['retryNo'];
|
||||||
|
$delay = $this->interval * 6 ** $retryNo;
|
||||||
|
return !isset($argument['lastRun']) || ((time() - $argument['lastRun']) > $delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue