<?php
namespace OCA\FuzzyImip\Cron;

use OCP\BackgroundJob\TimedJob;
use OCP\AppFramework\Utility\ITimeFactory;
use OCA\FuzzyImip\Service\FuzzyImipService;

class ProcessMail extends TimedJob {
    private FuzzyImipService $service;

    public function __construct(
        ITimeFactory $time,
        FuzzyImipService $service
    ) {
        parent::__construct($time);
        $this->setInterval(300);
        $this->service = $service;
    }

    protected function run($argument): void {
        $this->service->process();
    }
}
