f7cloud_client/apps/mail/lib/BackgroundJob/OutboxWorkerJob.php
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

34 lines
752 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2022 F7cloud GmbH and F7cloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Mail\BackgroundJob;
use OCA\Mail\Service\OutboxService;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
class OutboxWorkerJob extends TimedJob {
private OutboxService $outboxService;
public function __construct(ITimeFactory $time,
OutboxService $outboxService) {
parent::__construct($time);
// Run once per five minutes
$this->setInterval(5 * 60);
$this->setTimeSensitivity(self::TIME_SENSITIVE);
$this->outboxService = $outboxService;
}
#[\Override]
protected function run($argument): void {
$this->outboxService->flush();
}
}