diff options
author | provokateurin <kate@provokateurin.de> | 2024-10-07 17:36:55 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-10-08 11:26:53 +0200 |
commit | 54ec472d9a2c8a3d3c5daf0594bb887b11a81614 (patch) | |
tree | 98660989fcc8c32c938491e7da51ea3afbea5fa3 /apps | |
parent | d7aff6c1500fb85269945064d4c34085c4240425 (diff) | |
download | nextcloud-server-54ec472d9a2c8a3d3c5daf0594bb887b11a81614.tar.gz nextcloud-server-54ec472d9a2c8a3d3c5daf0594bb887b11a81614.zip |
fix(BackgroundJobs): Adjust intervals and time sensitivities
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps')
17 files changed, 19 insertions, 35 deletions
diff --git a/apps/contactsinteraction/lib/BackgroundJob/CleanupJob.php b/apps/contactsinteraction/lib/BackgroundJob/CleanupJob.php index 38fd0e15531..b89a2c1fbb3 100644 --- a/apps/contactsinteraction/lib/BackgroundJob/CleanupJob.php +++ b/apps/contactsinteraction/lib/BackgroundJob/CleanupJob.php @@ -10,7 +10,6 @@ namespace OCA\ContactsInteraction\BackgroundJob; use OCA\ContactsInteraction\Db\RecentContactMapper; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; class CleanupJob extends TimedJob { @@ -22,7 +21,7 @@ class CleanupJob extends TimedJob { parent::__construct($time); $this->setInterval(24 * 60 * 60); - $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } diff --git a/apps/dav/lib/BackgroundJob/UploadCleanup.php b/apps/dav/lib/BackgroundJob/UploadCleanup.php index 6d5eca6920c..aa19dbb22ec 100644 --- a/apps/dav/lib/BackgroundJob/UploadCleanup.php +++ b/apps/dav/lib/BackgroundJob/UploadCleanup.php @@ -10,7 +10,6 @@ namespace OCA\DAV\BackgroundJob; use OC\User\NoUserException; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\IJobList; use OCP\BackgroundJob\TimedJob; use OCP\Files\File; @@ -32,7 +31,7 @@ class UploadCleanup extends TimedJob { // Run once a day $this->setInterval(60 * 60 * 24); - $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } protected function run($argument) { diff --git a/apps/federation/lib/SyncJob.php b/apps/federation/lib/SyncJob.php index 3ec9453c805..7f41b20b921 100644 --- a/apps/federation/lib/SyncJob.php +++ b/apps/federation/lib/SyncJob.php @@ -19,6 +19,7 @@ class SyncJob extends TimedJob { parent::__construct($timeFactory); // Run once a day $this->setInterval(24 * 60 * 60); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); $this->syncService = $syncService; $this->logger = $logger; } diff --git a/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php b/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php index 376e1049469..b2bbe4477da 100644 --- a/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php +++ b/apps/files/lib/BackgroundJob/CleanupDirectEditingTokens.php @@ -13,14 +13,12 @@ use OCP\BackgroundJob\TimedJob; use OCP\DirectEditing\IManager; class CleanupDirectEditingTokens extends TimedJob { - private const INTERVAL_MINUTES = 15 * 60; - private IManager $manager; public function __construct(ITimeFactory $time, IManager $manager) { parent::__construct($time); - $this->interval = self::INTERVAL_MINUTES; + $this->setInterval(15 * 60); $this->manager = $manager; } diff --git a/apps/files/lib/BackgroundJob/CleanupFileLocks.php b/apps/files/lib/BackgroundJob/CleanupFileLocks.php index 69efb664302..a332c1434fc 100644 --- a/apps/files/lib/BackgroundJob/CleanupFileLocks.php +++ b/apps/files/lib/BackgroundJob/CleanupFileLocks.php @@ -16,19 +16,11 @@ use OCP\BackgroundJob\TimedJob; */ class CleanupFileLocks extends TimedJob { /** - * Default interval in minutes - * - * @var int $defaultIntervalMin - **/ - protected $defaultIntervalMin = 5; - - /** * sets the correct interval for this timed job */ public function __construct(ITimeFactory $time) { parent::__construct($time); - - $this->interval = $this->defaultIntervalMin * 60; + $this->setInterval(5 * 60); } /** diff --git a/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php b/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php index ce2de9a74bb..3a7aaa199d1 100644 --- a/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php +++ b/apps/files/lib/BackgroundJob/DeleteExpiredOpenLocalEditor.php @@ -11,7 +11,6 @@ namespace OCA\Files\BackgroundJob; use OCA\Files\Db\OpenLocalEditorMapper; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; /** @@ -29,7 +28,7 @@ class DeleteExpiredOpenLocalEditor extends TimedJob { // Run every 12h $this->interval = 12 * 3600; - $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } /** diff --git a/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php b/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php index b1a795b775c..b925974f24a 100644 --- a/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php +++ b/apps/files/lib/BackgroundJob/DeleteOrphanedItems.php @@ -18,7 +18,6 @@ use Psr\Log\LoggerInterface; */ class DeleteOrphanedItems extends TimedJob { public const CHUNK_SIZE = 200; - protected $defaultIntervalMin = 60; /** * sets the correct interval for this timed job @@ -29,7 +28,7 @@ class DeleteOrphanedItems extends TimedJob { protected LoggerInterface $logger, ) { parent::__construct($time); - $this->interval = $this->defaultIntervalMin * 60; + $this->setInterval(60 * 60); } /** diff --git a/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php b/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php index 36eaa2d51ce..6d86c2f347b 100644 --- a/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php +++ b/apps/files_external/lib/BackgroundJob/CredentialsCleanup.php @@ -12,7 +12,6 @@ use OCA\Files_External\Lib\Auth\Password\LoginCredentials; use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\Service\UserGlobalStoragesService; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; use OCP\IUser; use OCP\IUserManager; @@ -37,7 +36,7 @@ class CredentialsCleanup extends TimedJob { // run every day $this->setInterval(24 * 60 * 60); - $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } protected function run($argument) { diff --git a/apps/files_reminders/lib/BackgroundJob/CleanUpReminders.php b/apps/files_reminders/lib/BackgroundJob/CleanUpReminders.php index 234e133ffc7..35b72b190e8 100644 --- a/apps/files_reminders/lib/BackgroundJob/CleanUpReminders.php +++ b/apps/files_reminders/lib/BackgroundJob/CleanUpReminders.php @@ -11,7 +11,6 @@ namespace OCA\FilesReminders\BackgroundJob; use OCA\FilesReminders\Service\ReminderService; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; class CleanUpReminders extends TimedJob { @@ -22,7 +21,7 @@ class CleanUpReminders extends TimedJob { parent::__construct($time); $this->setInterval(24 * 60 * 60); // 1 day - $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } /** diff --git a/apps/files_sharing/lib/BackgroundJob/FederatedSharesDiscoverJob.php b/apps/files_sharing/lib/BackgroundJob/FederatedSharesDiscoverJob.php index 9b1b0062ce5..44b473ac64d 100644 --- a/apps/files_sharing/lib/BackgroundJob/FederatedSharesDiscoverJob.php +++ b/apps/files_sharing/lib/BackgroundJob/FederatedSharesDiscoverJob.php @@ -26,7 +26,8 @@ class FederatedSharesDiscoverJob extends TimedJob { private LoggerInterface $logger, ) { parent::__construct($time); - $this->setInterval(86400); + $this->setInterval(24 * 60 * 60); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } public function run($argument) { diff --git a/apps/files_sharing/lib/ExpireSharesJob.php b/apps/files_sharing/lib/ExpireSharesJob.php index cd8490291d2..39002250924 100644 --- a/apps/files_sharing/lib/ExpireSharesJob.php +++ b/apps/files_sharing/lib/ExpireSharesJob.php @@ -7,7 +7,6 @@ namespace OCA\Files_Sharing; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; use OCP\IDBConnection; use OCP\Share\Exceptions\ShareNotFound; @@ -33,7 +32,7 @@ class ExpireSharesJob extends TimedJob { // Run once a day $this->setInterval(24 * 60 * 60); - $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } diff --git a/apps/files_sharing/lib/SharesReminderJob.php b/apps/files_sharing/lib/SharesReminderJob.php index af279bbc146..b3b3590ec09 100644 --- a/apps/files_sharing/lib/SharesReminderJob.php +++ b/apps/files_sharing/lib/SharesReminderJob.php @@ -33,7 +33,7 @@ use Psr\Log\LoggerInterface; * Send a reminder via email to the sharee(s) if the folder is still empty a predefined time before the expiration date */ class SharesReminderJob extends TimedJob { - private const SECONDS_BEFORE_REMINDER = 86400; + private const SECONDS_BEFORE_REMINDER = 24 * 60 * 60; private const CHUNK_SIZE = 1000; private int $folderMimeTypeId; @@ -50,7 +50,7 @@ class SharesReminderJob extends TimedJob { IMimeTypeLoader $mimeTypeLoader, ) { parent::__construct($time); - $this->setInterval(3600); + $this->setInterval(60 * 60); $this->folderMimeTypeId = $mimeTypeLoader->getId(ICacheEntry::DIRECTORY_MIMETYPE); } diff --git a/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php b/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php index d1647381ffa..b819a45ace2 100644 --- a/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php +++ b/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php @@ -12,7 +12,6 @@ namespace OCA\OAuth2\BackgroundJob; use OCA\OAuth2\Db\AccessTokenMapper; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; use OCP\DB\Exception; use Psr\Log\LoggerInterface; @@ -27,7 +26,7 @@ class CleanupExpiredAuthorizationCode extends TimedJob { parent::__construct($timeFactory); // 30 days $this->setInterval(60 * 60 * 24 * 30); - $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } /** diff --git a/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php b/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php index 2bf182d59fd..61b93803a0d 100644 --- a/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php +++ b/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php @@ -10,7 +10,6 @@ namespace OCA\TwoFactorBackupCodes\BackgroundJob; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Authentication\TwoFactorAuth\IRegistry; -use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\IJobList; use OCP\BackgroundJob\TimedJob; use OCP\IUserManager; @@ -43,7 +42,7 @@ class RememberBackupCodesJob extends TimedJob { $this->jobList = $jobList; $this->setInterval(60 * 60 * 24 * 14); - $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } protected function run($argument) { diff --git a/apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php b/apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php index 30786f5e12d..7f8402570bc 100644 --- a/apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php +++ b/apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php @@ -40,6 +40,7 @@ class UpdateAvailableNotifications extends TimedJob { parent::__construct($timeFactory); // Run once a day $this->setInterval(60 * 60 * 24); + $this->setTimeSensitivity(self::TIME_INSENSITIVE); } protected function run($argument) { diff --git a/apps/user_ldap/lib/Jobs/CleanUp.php b/apps/user_ldap/lib/Jobs/CleanUp.php index b04dc67ef49..088a563dc27 100644 --- a/apps/user_ldap/lib/Jobs/CleanUp.php +++ b/apps/user_ldap/lib/Jobs/CleanUp.php @@ -27,7 +27,7 @@ class CleanUp extends TimedJob { protected $limit; /** @var int $defaultIntervalMin default interval in minutes */ - protected $defaultIntervalMin = 51; + protected $defaultIntervalMin = 60; /** @var User_LDAP|User_Proxy $userBackend */ protected $userBackend; diff --git a/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php b/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php index 1810f7aa118..edf3b657724 100644 --- a/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php +++ b/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php @@ -35,7 +35,7 @@ class ClearOldStatusesBackgroundJob extends TimedJob { $this->mapper = $mapper; // Run every time the cron is run - $this->setInterval(60); + $this->setInterval(0); } /** |