Ports the standalone due-date cron script into a proper Nextcloud 34 app with a personal-settings UI, per-user workflow configuration (source/target stack, assigned-user and label filters, email notification), a TimedJob background runner, and Gitea CI pipelines. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
27 lines
604 B
PHP
27 lines
604 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\WorkflowDeckAutomation\BackgroundJob;
|
|
|
|
use OCA\WorkflowDeckAutomation\Service\WorkflowRunner;
|
|
use OCP\AppFramework\Utility\ITimeFactory;
|
|
use OCP\BackgroundJob\IJob;
|
|
use OCP\BackgroundJob\TimedJob;
|
|
|
|
class RunWorkflowsJob extends TimedJob {
|
|
public function __construct(
|
|
ITimeFactory $time,
|
|
private WorkflowRunner $runner,
|
|
) {
|
|
parent::__construct($time);
|
|
$this->setInterval(5 * 60);
|
|
$this->setTimeSensitivity(IJob::TIME_INSENSITIVE);
|
|
$this->setAllowParallelRuns(false);
|
|
}
|
|
|
|
protected function run($argument): void {
|
|
$this->runner->run();
|
|
}
|
|
}
|