From e42ffa4ca2c6d92bce0e34142d91b4d1ef9f8507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 24 Feb 2022 14:08:46 +0100 Subject: [PATCH] Move DeleteCron to be time insensitive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Cron/CardDescriptionActivity.php | 2 +- lib/Cron/DeleteCron.php | 8 ++++++-- lib/Cron/ScheduledNotifications.php | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Cron/CardDescriptionActivity.php b/lib/Cron/CardDescriptionActivity.php index bf3cee9e8b..14f73965b5 100644 --- a/lib/Cron/CardDescriptionActivity.php +++ b/lib/Cron/CardDescriptionActivity.php @@ -24,7 +24,7 @@ namespace OCA\Deck\Cron; -use OC\BackgroundJob\Job; +use OCP\BackgroundJob\Job; use OCA\Deck\Activity\ActivityManager; use OCA\Deck\Db\CardMapper; diff --git a/lib/Cron/DeleteCron.php b/lib/Cron/DeleteCron.php index 49a26d136f..f6554edb79 100644 --- a/lib/Cron/DeleteCron.php +++ b/lib/Cron/DeleteCron.php @@ -24,13 +24,14 @@ namespace OCA\Deck\Cron; -use OC\BackgroundJob\Job; +use OCP\BackgroundJob\TimedJob; use OCA\Deck\Db\AttachmentMapper; use OCA\Deck\Db\BoardMapper; use OCA\Deck\InvalidAttachmentType; use OCA\Deck\Service\AttachmentService; +use OCP\BackgroundJob\IJob; -class DeleteCron extends Job { +class DeleteCron extends TimedJob { /** @var BoardMapper */ private $boardMapper; @@ -43,6 +44,9 @@ public function __construct(BoardMapper $boardMapper, AttachmentService $attachm $this->boardMapper = $boardMapper; $this->attachmentService = $attachmentService; $this->attachmentMapper = $attachmentMapper; + + $this->setInterval(60 * 60 * 24); + $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); } /** diff --git a/lib/Cron/ScheduledNotifications.php b/lib/Cron/ScheduledNotifications.php index fe42168e52..c6fbdd381f 100644 --- a/lib/Cron/ScheduledNotifications.php +++ b/lib/Cron/ScheduledNotifications.php @@ -23,7 +23,7 @@ namespace OCA\Deck\Cron; -use OC\BackgroundJob\Job; +use OCP\BackgroundJob\Job; use OCA\Deck\Db\Card; use OCA\Deck\Db\CardMapper; use OCA\Deck\Notification\NotificationHelper;