diff options
Diffstat (limited to 'lib')
7 files changed, 14 insertions, 13 deletions
diff --git a/lib/private/Preview/BackgroundCleanupJob.php b/lib/private/Preview/BackgroundCleanupJob.php index 8449e73983c..ad5e793474b 100644 --- a/lib/private/Preview/BackgroundCleanupJob.php +++ b/lib/private/Preview/BackgroundCleanupJob.php @@ -37,7 +37,8 @@ class BackgroundCleanupJob extends TimedJob { bool $isCLI) { parent::__construct($timeFactory); // Run at most once an hour - $this->setInterval(3600); + $this->setInterval(60 * 60); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); $this->connection = $connection; $this->previewFolder = $previewFolder; diff --git a/lib/private/Security/Bruteforce/CleanupJob.php b/lib/private/Security/Bruteforce/CleanupJob.php index e7d981caa08..fdf7fb97d31 100644 --- a/lib/private/Security/Bruteforce/CleanupJob.php +++ b/lib/private/Security/Bruteforce/CleanupJob.php @@ -9,7 +9,6 @@ declare(strict_types=1); namespace OC\Security\Bruteforce; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; @@ -22,8 +21,8 @@ class CleanupJob extends TimedJob { parent::__construct($time); // Run once a day - $this->setInterval(3600 * 24); - $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); + $this->setInterval(60 * 60 * 24); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } protected function run($argument): void { diff --git a/lib/private/TaskProcessing/RemoveOldTasksBackgroundJob.php b/lib/private/TaskProcessing/RemoveOldTasksBackgroundJob.php index acec2f46c05..c6f26e3aa8b 100644 --- a/lib/private/TaskProcessing/RemoveOldTasksBackgroundJob.php +++ b/lib/private/TaskProcessing/RemoveOldTasksBackgroundJob.php @@ -16,7 +16,7 @@ use OCP\Files\SimpleFS\ISimpleFolder; use Psr\Log\LoggerInterface; class RemoveOldTasksBackgroundJob extends TimedJob { - public const MAX_TASK_AGE_SECONDS = 60 * 50 * 24 * 7 * 4; // 4 weeks + public const MAX_TASK_AGE_SECONDS = 60 * 60 * 24 * 7 * 4; // 4 weeks private \OCP\Files\IAppData $appData; public function __construct( @@ -28,7 +28,7 @@ class RemoveOldTasksBackgroundJob extends TimedJob { parent::__construct($timeFactory); $this->setInterval(60 * 60 * 24); // can be deferred to maintenance window - $this->setTimeSensitivity(TimedJob::TIME_INSENSITIVE); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); $this->appData = $appDataFactory->get('core'); } diff --git a/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php b/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php index 4a336d56077..be5e4127d08 100644 --- a/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php +++ b/lib/private/TextProcessing/RemoveOldTasksBackgroundJob.php @@ -17,7 +17,7 @@ use OCP\DB\Exception; use Psr\Log\LoggerInterface; class RemoveOldTasksBackgroundJob extends TimedJob { - public const MAX_TASK_AGE_SECONDS = 60 * 50 * 24 * 7; // 1 week + public const MAX_TASK_AGE_SECONDS = 60 * 60 * 24 * 7; // 1 week public function __construct( ITimeFactory $timeFactory, @@ -26,6 +26,7 @@ class RemoveOldTasksBackgroundJob extends TimedJob { ) { parent::__construct($timeFactory); $this->setInterval(60 * 60 * 24); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } /** diff --git a/lib/private/TextToImage/RemoveOldTasksBackgroundJob.php b/lib/private/TextToImage/RemoveOldTasksBackgroundJob.php index 7d9170090b7..225984a7956 100644 --- a/lib/private/TextToImage/RemoveOldTasksBackgroundJob.php +++ b/lib/private/TextToImage/RemoveOldTasksBackgroundJob.php @@ -21,7 +21,7 @@ use OCP\Files\NotPermittedException; use Psr\Log\LoggerInterface; class RemoveOldTasksBackgroundJob extends TimedJob { - public const MAX_TASK_AGE_SECONDS = 60 * 50 * 24 * 7; // 1 week + public const MAX_TASK_AGE_SECONDS = 60 * 60 * 24 * 7; // 1 week private IAppData $appData; @@ -34,6 +34,7 @@ class RemoveOldTasksBackgroundJob extends TimedJob { parent::__construct($timeFactory); $this->appData = $appDataFactory->get('core'); $this->setInterval(60 * 60 * 24); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } /** diff --git a/lib/private/User/BackgroundJobs/CleanupDeletedUsers.php b/lib/private/User/BackgroundJobs/CleanupDeletedUsers.php index 3c1b73637ac..f999031a2a9 100644 --- a/lib/private/User/BackgroundJobs/CleanupDeletedUsers.php +++ b/lib/private/User/BackgroundJobs/CleanupDeletedUsers.php @@ -12,7 +12,6 @@ use OC\User\Manager; use OC\User\PartiallyDeletedUsersBackend; use OC\User\User; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; @@ -26,8 +25,8 @@ class CleanupDeletedUsers extends TimedJob { private LoggerInterface $logger, ) { parent::__construct($time); - $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); - $this->setInterval(24 * 3600); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); + $this->setInterval(24 * 60 * 60); } protected function run($argument): void { diff --git a/lib/public/BackgroundJob/TimedJob.php b/lib/public/BackgroundJob/TimedJob.php index bec3f21fe16..6a81e841460 100644 --- a/lib/public/BackgroundJob/TimedJob.php +++ b/lib/public/BackgroundJob/TimedJob.php @@ -52,8 +52,8 @@ abstract class TimedJob extends Job { * @since 24.0.0 */ public function setTimeSensitivity(int $sensitivity): void { - if ($sensitivity !== IJob::TIME_SENSITIVE && - $sensitivity !== IJob::TIME_INSENSITIVE) { + if ($sensitivity !== self::TIME_SENSITIVE && + $sensitivity !== self::TIME_INSENSITIVE) { throw new \InvalidArgumentException('Invalid sensitivity'); } |