From 5ede903d13f5e001928c6f65daeaf28bef2ca454 Mon Sep 17 00:00:00 2001 From: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> Date: Fri, 6 Jun 2025 16:22:01 +0200 Subject: [PATCH] fix: adjust setTimeout value for ClearOldStatusesBackgroundJob Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> --- apps/dav/lib/BackgroundJob/UserStatusAutomation.php | 5 +++-- .../lib/BackgroundJob/ClearOldStatusesBackgroundJob.php | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php index 8d5c229241d84..f6fcc2536d1ca 100644 --- a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php +++ b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php @@ -38,8 +38,9 @@ public function __construct(private ITimeFactory $timeFactory, private IUserManager $userManager) { parent::__construct($timeFactory); - // Interval 0 might look weird, but the last_checked is always moved - // to the next time we need this and then it's 0 seconds ago. + // interval = 0 might look odd, but it's intentional. last_run is set to + // the user's next available time, so the job runs immediately when + // that time comes. $this->setInterval(0); } diff --git a/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php b/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php index edf3b65772402..91dcfafe71d54 100644 --- a/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php +++ b/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php @@ -34,8 +34,7 @@ public function __construct(ITimeFactory $time, parent::__construct($time); $this->mapper = $mapper; - // Run every time the cron is run - $this->setInterval(0); + $this->setInterval(60); } /**