Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| Reminder | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| run | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | /** |
| 5 | * SPDX-FileCopyrightText: 2025 LibreCode coop and contributors |
| 6 | * SPDX-License-Identifier: AGPL-3.0-or-later |
| 7 | */ |
| 8 | |
| 9 | namespace OCA\Libresign\BackgroundJob; |
| 10 | |
| 11 | use OCA\Libresign\Service\ReminderService; |
| 12 | use OCP\AppFramework\Utility\ITimeFactory; |
| 13 | use OCP\BackgroundJob\IJob; |
| 14 | use OCP\BackgroundJob\TimedJob; |
| 15 | |
| 16 | class Reminder extends TimedJob { |
| 17 | public function __construct( |
| 18 | ITimeFactory $time, |
| 19 | protected ReminderService $reminderService, |
| 20 | ) { |
| 21 | parent::__construct($time); |
| 22 | |
| 23 | // Every day |
| 24 | $this->setInterval(60 * 60 * 24); |
| 25 | $this->setTimeSensitivity(IJob::TIME_SENSITIVE); |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * @inheritDoc |
| 30 | */ |
| 31 | #[\Override] |
| 32 | public function run($argument): void { |
| 33 | $this->reminderService->sendReminders(); |
| 34 | } |
| 35 | } |