Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-12-14 18:35:12 +0300
committerJoas Schilling <coding@schilljs.com>2020-12-14 18:35:12 +0300
commit96253c7c1b02c9e3a5506198c179dd7a32d01fbe (patch)
tree3c35cede81cf3978d1553ff1932c5818a9dd86d4 /apps/federatedfilesharing/lib
parent39bee7948d44c2f5d6f5465bc9c4c3ffe6b8c34e (diff)
Add missing parent::__construct() calls to Jobs
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/federatedfilesharing/lib')
-rw-r--r--apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php33
1 files changed, 8 insertions, 25 deletions
diff --git a/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php b/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php
index 4949e5794b4..14d86d4b444 100644
--- a/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php
+++ b/apps/federatedfilesharing/lib/BackgroundJob/RetryJob.php
@@ -29,6 +29,7 @@ namespace OCA\FederatedFileSharing\BackgroundJob;
use OCA\FederatedFileSharing\AddressHandler;
use OCA\FederatedFileSharing\Notifications;
+use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\Job;
use OCP\ILogger;
@@ -55,29 +56,11 @@ class RetryJob extends Job {
/** @var int how much time should be between two tries (10 minutes) */
private $interval = 600;
- /**
- * UnShare constructor.
- *
- * @param Notifications $notifications
- */
- public function __construct(Notifications $notifications = null) {
- if ($notifications) {
- $this->notifications = $notifications;
- } else {
- $addressHandler = new AddressHandler(
- \OC::$server->getURLGenerator(),
- \OC::$server->getL10N('federatedfilesharing'),
- \OC::$server->getCloudIdManager()
- );
- $this->notifications = new Notifications(
- $addressHandler,
- \OC::$server->getHTTPClientService(),
- \OC::$server->query(\OCP\OCS\IDiscoveryService::class),
- \OC::$server->getJobList(),
- \OC::$server->getCloudFederationProviderManager(),
- \OC::$server->getCloudFederationFactory()
- );
- }
+
+ public function __construct(Notifications $notifications,
+ ITimeFactory $timeFactory) {
+ parent::__construct($timeFactory);
+ $this->notifications = $notifications;
}
/**
@@ -126,7 +109,7 @@ class RetryJob extends Job {
'data' => $argument['data'],
'action' => $argument['action'],
'try' => (int)$argument['try'] + 1,
- 'lastRun' => time()
+ 'lastRun' => $this->time->getTime()
]
);
}
@@ -139,6 +122,6 @@ class RetryJob extends Job {
*/
protected function shouldRun(array $argument) {
$lastRun = (int)$argument['lastRun'];
- return ((time() - $lastRun) > $this->interval);
+ return (($this->time->getTime() - $lastRun) > $this->interval);
}
}