diff options
author | Stephan Orbaugh <62374139+sorbaugh@users.noreply.github.com> | 2024-11-25 09:49:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-25 09:49:30 +0100 |
commit | 03f8e900017bf0b4a87f0024c9ee35fada461a4e (patch) | |
tree | 94849d375bea08eaeb388bc590c4b9305ad7c276 /apps | |
parent | fb439dad5e6c1dc6051b5cb6bcb4fc6c2906e6dd (diff) | |
parent | a7f5b452d185e5122d38c3a4c23af3215135c4eb (diff) | |
download | nextcloud-server-03f8e900017bf0b4a87f0024c9ee35fada461a4e.tar.gz nextcloud-server-03f8e900017bf0b4a87f0024c9ee35fada461a4e.zip |
Merge pull request #49461 from nextcloud/backport/48600/stable30
[stable30] fix(BackgroundJobs): Adjust intervals and time sensitivities
Diffstat (limited to 'apps')
16 files changed, 17 insertions, 33 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 59a28626ecd..d90e6cbd171 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 fe6454cd5b1..74de9d91c1e 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 81f3d229bc0..84ba98da092 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 1ae80735972..db070d837ec 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/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php b/apps/oauth2/lib/BackgroundJob/CleanupExpiredAuthorizationCode.php index 84d62ab6b45..0907e823a47 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; @@ -28,7 +27,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 dd6497c7e48..c6296de05a1 100644 --- a/apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php +++ b/apps/updatenotification/lib/BackgroundJob/UpdateAvailableNotifications.php @@ -38,6 +38,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 22c878ed067..1f2bf8dcb7e 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); } /** |