From e4183236ed40bcf33d50fa9c3882400186f4536b 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 These jobs that were setting their interval to 0 were not really running at every run of cron.php if the run was in the same second. To keep the same behaior, I am updating those intervals to 1 second. 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 7cc56698a9f..027b3349802 100644 --- a/apps/dav/lib/BackgroundJob/UserStatusAutomation.php +++ b/apps/dav/lib/BackgroundJob/UserStatusAutomation.php @@ -40,8 +40,9 @@ class UserStatusAutomation extends TimedJob { ) { 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 331d88de747..51a9c623a03 100644 --- a/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php +++ b/apps/user_status/lib/BackgroundJob/ClearOldStatusesBackgroundJob.php @@ -32,8 +32,7 @@ class ClearOldStatusesBackgroundJob extends TimedJob { ) { parent::__construct($time); - // Run every time the cron is run - $this->setInterval(0); + $this->setInterval(60); } /**