Nextcloud-App/lib/BackgroundJob/MatrixListener.php

29 lines
767 B
PHP

<?php
namespace OCA\UPschooling\BackgroundJob;
use OCA\UPschooling\Service\MatrixListenerService;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
use Psr\Log\LoggerInterface;
class MatrixListener extends TimedJob {
/** @var MatrixListenerService */
private $matrixListenerService;
/** @var LoggerInterface */
private $logger;
public function __construct(ITimeFactory $time, MatrixListenerService $matrixListenerService, LoggerInterface $logger) {
parent::__construct($time);
parent::setInterval(1);
$this->logger = $logger;
$this->matrixListenerService = $matrixListenerService;
}
protected function run($argument) {
$this->matrixListenerService->listen();
}
}