. * */ namespace OCA\Passman\BackgroundJob; use OCA\Passman\Service\CronService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\TimedJob; use OCP\IConfig; /** * Class ExpireCredentials * * @package OCA\Passman\BackgroundJob */ class ExpireCredentials extends TimedJob { /** * ExpireCredentials constructor. * * @param ITimeFactory $timeFactory * @param IConfig $config * @param CronService $cronService */ public function __construct( ITimeFactory $timeFactory, protected IConfig $config, private CronService $cronService, ) { parent::__construct($timeFactory); // Run once per minute $this->setInterval(60); } protected function run($argument): void { $this->cronService->expireCredentials(); } }