From 947fb67113e248220df13fc5cbc78c46470f5bde Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Sun, 9 Aug 2026 20:32:52 +0200 Subject: [PATCH] fix: Mark update storage stats as time insensitive Signed-off-by: Daniel Kesselberg --- lib/Jobs/UpdateStorageStats.php | 19 +++++++++++-------- tests/psalm-baseline.xml | 5 ----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/Jobs/UpdateStorageStats.php b/lib/Jobs/UpdateStorageStats.php index 3eb6ad12..96006791 100644 --- a/lib/Jobs/UpdateStorageStats.php +++ b/lib/Jobs/UpdateStorageStats.php @@ -11,22 +11,25 @@ use OCA\ServerInfo\StorageStatistics; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\TimedJob; use OCP\IAppConfig; +/** + * @psalm-api + */ class UpdateStorageStats extends TimedJob { - private StorageStatistics $storageStatistics; - public function __construct(ITimeFactory $time, StorageStatistics $storageStatistics, IAppConfig $appConfig) { - $this->setInterval($appConfig->getValueInt('serverinfo', 'job_interval_storage_stats', 60 * 60 * 3)); + public function __construct( + ITimeFactory $time, + private StorageStatistics $storageStatistics, + IAppConfig $appConfig, + ) { parent::__construct($time); - - $this->storageStatistics = $storageStatistics; + $this->setInterval($appConfig->getValueInt('serverinfo', 'job_interval_storage_stats', 60 * 60 * 3)); + $this->setTimeSensitivity(IJob::TIME_INSENSITIVE); } - /** - * @inheritDoc - */ #[\Override] protected function run($argument): void { $this->storageStatistics->updateStorageCounts(); diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 0616cb74..7b5a53f5 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -40,11 +40,6 @@ - - - - -