Mark background jobs as time sensitive/insensitive

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2022-02-18 17:35:16 +01:00
parent 526b38ed66
commit ab11a0819d
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
1 changed files with 9 additions and 1 deletions

View File

@ -31,6 +31,7 @@ use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use OCP\ILogger;
use Psr\Log\LoggerInterface;
use function method_exists;
class CleanUpOutdatedBookingsJob extends TimedJob {
/** @var ILogger */
@ -43,9 +44,16 @@ class CleanUpOutdatedBookingsJob extends TimedJob {
BookingService $service,
LoggerInterface $logger) {
parent::__construct($time);
$this->setInterval(24 * 60 * 60);
$this->service = $service;
$this->logger = $logger;
$this->setInterval(24 * 60 * 60);
/**
* @todo remove check with 24+
*/
if (method_exists($this, 'setTimeSensitivity')) {
$this->setTimeSensitivity(self::TIME_INSENSITIVE);
}
}