From 1d8f7882307521ddfb5e2db06684d7edd645d788 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Sun, 24 May 2026 11:25:00 +0200 Subject: [PATCH] fix(files_reminders): keep batch alive on per-row failure Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- .../lib/BackgroundJob/ScheduledNotifications.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/files_reminders/lib/BackgroundJob/ScheduledNotifications.php b/apps/files_reminders/lib/BackgroundJob/ScheduledNotifications.php index 8e615c3a6d6f2..51c752f46d150 100644 --- a/apps/files_reminders/lib/BackgroundJob/ScheduledNotifications.php +++ b/apps/files_reminders/lib/BackgroundJob/ScheduledNotifications.php @@ -11,10 +11,10 @@ use OCA\FilesReminders\Db\ReminderMapper; use OCA\FilesReminders\Service\ReminderService; -use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\TimedJob; use Psr\Log\LoggerInterface; +use Throwable; class ScheduledNotifications extends TimedJob { public function __construct( @@ -37,8 +37,11 @@ public function run($argument) { foreach ($reminders as $reminder) { try { $this->reminderService->send($reminder); - } catch (DoesNotExistException $e) { - $this->logger->debug('Could not send notification for reminder with id ' . $reminder->getId()); + } catch (Throwable $e) { + // A single broken reminder (e.g. orphaned user record) must not + // stall the rest of the queue, which is ordered by due_date ASC + // and would otherwise re-hit the same row on every cron tick. + $this->logger->error('Could not send notification for reminder with id ' . $reminder->getId(), ['exception' => $e]); } } }