diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2019-02-20 10:20:45 +0100 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2019-02-20 10:20:45 +0100 |
commit | f6b0a65c5a4112a5502a084cc7bcbc5867e2cab6 (patch) | |
tree | 6ba6ec7e555a662ae2483662a5c0811c1bea63fe /apps/lookup_server_connector | |
parent | d4134982f5dbe6b1edab47e72de4f383ad7b40b8 (diff) | |
download | nextcloud-server-f6b0a65c5a4112a5502a084cc7bcbc5867e2cab6.tar.gz nextcloud-server-f6b0a65c5a4112a5502a084cc7bcbc5867e2cab6.zip |
increase timespan between each retry
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/lookup_server_connector')
-rw-r--r-- | apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php b/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php index 3b110ead1e3..ed859a71976 100644 --- a/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php +++ b/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php @@ -36,8 +36,8 @@ class RetryJob extends Job { private $jobList; /** @var string */ private $lookupServer; - /** @var int how much time should be between two tries (10 minutes) */ - private $interval = 600; + /** @var int how much time should be between two, will be increased for each retry */ + private $interval = 100; /** * @param IClientService $clientService @@ -108,7 +108,9 @@ class RetryJob extends Job { * @return bool */ 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); } /** |