12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- declare(strict_types=1);
- namespace OCA\User_LDAP\Jobs;
- use OCA\User_LDAP\Service\UpdateGroupsService;
- use OCP\AppFramework\Utility\ITimeFactory;
- use OCP\BackgroundJob\TimedJob;
- use OCP\DB\Exception;
- use OCP\IConfig;
- use Psr\Log\LoggerInterface;
- class UpdateGroups extends TimedJob {
- public function __construct(
- private UpdateGroupsService $service,
- private LoggerInterface $logger,
- IConfig $config,
- ITimeFactory $timeFactory,
- ) {
- parent::__construct($timeFactory);
- $this->interval = (int)$config->getAppValue('user_ldap', 'bgjRefreshInterval', '3600');
- }
-
- public function run($argument): void {
- $this->logger->debug('Run background job "updateGroups"');
- $this->service->updateGroups();
- }
- }
|