12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- declare(strict_types=1);
- namespace OCA\DAV\BackgroundJob;
- use OC\User\NoUserException;
- use OCA\DAV\CalDAV\Reminder\NotificationProvider\ProviderNotAvailableException;
- use OCA\DAV\CalDAV\Reminder\NotificationTypeDoesNotExistException;
- use OCA\DAV\CalDAV\Reminder\ReminderService;
- use OCP\AppFramework\Utility\ITimeFactory;
- use OCP\BackgroundJob\TimedJob;
- use OCP\IConfig;
- class EventReminderJob extends TimedJob {
- public function __construct(
- ITimeFactory $time,
- private ReminderService $reminderService,
- private IConfig $config,
- ) {
- parent::__construct($time);
-
- $this->setInterval(5 * 60);
- $this->setTimeSensitivity(self::TIME_SENSITIVE);
- }
-
- public function run($argument):void {
- if ($this->config->getAppValue('dav', 'sendEventReminders', 'yes') !== 'yes') {
- return;
- }
- if ($this->config->getAppValue('dav', 'sendEventRemindersMode', 'backgroundjob') !== 'backgroundjob') {
- return;
- }
- $this->reminderService->processReminders();
- }
- }
|