summaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-12-05 10:13:34 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-12-05 10:13:34 +0100
commita0f6a6545b59b1061e96e7d17d8ec6d6f32e615e (patch)
treeb98e1679b900f1518acdcea69884c25f1cd0f962 /apps/files/lib
parent944be7950a0199dbc48b99dac936987b13dd0383 (diff)
downloadnextcloud-server-a0f6a6545b59b1061e96e7d17d8ec6d6f32e615e.tar.gz
nextcloud-server-a0f6a6545b59b1061e96e7d17d8ec6d6f32e615e.zip
Use TimedJob from OCP instead of OC
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php15
-rw-r--r--apps/files/lib/BackgroundJob/CleanupFileLocks.php8
-rw-r--r--apps/files/lib/BackgroundJob/DeleteOrphanedItems.php6
3 files changed, 18 insertions, 11 deletions
diff --git a/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php b/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php
index 16f76a76dd8..a9b5b1446b2 100644
--- a/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php
+++ b/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* @copyright Copyright (c) 2016 Julius Härtl <jus@bitgrid.net>
*
@@ -23,18 +26,18 @@
*/
namespace OCA\Files\BackgroundJob;
-use OC\BackgroundJob\TimedJob;
+use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\BackgroundJob\TimedJob;
use OCP\DirectEditing\IManager;
class CleanupDirectEditingTokens extends TimedJob {
private const INTERVAL_MINUTES = 15 * 60;
- /**
- * @var IManager
- */
- private $manager;
+ private IManager $manager;
- public function __construct(IManager $manager) {
+ public function __construct(ITimeFactory $time,
+ IManager $manager) {
+ parent::__construct($time);
$this->interval = self::INTERVAL_MINUTES;
$this->manager = $manager;
}
diff --git a/apps/files/lib/BackgroundJob/CleanupFileLocks.php b/apps/files/lib/BackgroundJob/CleanupFileLocks.php
index f22b8edcd9b..e0ad72eaaf0 100644
--- a/apps/files/lib/BackgroundJob/CleanupFileLocks.php
+++ b/apps/files/lib/BackgroundJob/CleanupFileLocks.php
@@ -23,14 +23,14 @@
*/
namespace OCA\Files\BackgroundJob;
-use OC\BackgroundJob\TimedJob;
+use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\BackgroundJob\TimedJob;
use OC\Lock\DBLockingProvider;
/**
* Clean up all file locks that are expired for the DB file locking provider
*/
class CleanupFileLocks extends TimedJob {
-
/**
* Default interval in minutes
*
@@ -41,7 +41,9 @@ class CleanupFileLocks extends TimedJob {
/**
* sets the correct interval for this timed job
*/
- public function __construct() {
+ public function __construct(ITimeFactory $time) {
+ parent::__construct($time);
+
$this->interval = $this->defaultIntervalMin * 60;
}
diff --git a/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php b/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php
index 720785f5727..669c2a4cde6 100644
--- a/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php
+++ b/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php
@@ -24,7 +24,8 @@
*/
namespace OCA\Files\BackgroundJob;
-use OC\BackgroundJob\TimedJob;
+use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\BackgroundJob\TimedJob;
use OCP\DB\QueryBuilder\IQueryBuilder;
/**
@@ -49,7 +50,8 @@ class DeleteOrphanedItems extends TimedJob {
/**
* sets the correct interval for this timed job
*/
- public function __construct() {
+ public function __construct(ITimeFactory $time) {
+ parent::__construct($time);
$this->interval = $this->defaultIntervalMin * 60;
$this->connection = \OC::$server->getDatabaseConnection();
$this->logger = \OC::$server->getLogger();