Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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]);
}
}
}
Expand Down
Loading