mirror of
https://github.com/nextcloud/server.git
synced 2026-06-14 19:20:35 -04:00
fix(files_reminders): keep batch alive on per-row failure
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
parent
8609cd45ba
commit
1d8f788230
1 changed files with 6 additions and 3 deletions
|
|
@ -11,10 +11,10 @@ namespace OCA\FilesReminders\BackgroundJob;
|
|||
|
||||
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 @@ class ScheduledNotifications extends TimedJob {
|
|||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue