diff options
author | Louis Chemineau <louis@chmn.me> | 2024-02-08 15:31:19 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2024-02-08 15:31:19 +0100 |
commit | 898df41de968321926e10ad532a64c3915ddad29 (patch) | |
tree | 57a0e5ada151890ddf71550f22b502e1f67aeffd /apps/settings/lib/BackgroundJobs/VerifyUserData.php | |
parent | d9d60238c7aaab9c61bf2d50c15aa59bc88c8975 (diff) | |
download | nextcloud-server-898df41de968321926e10ad532a64c3915ddad29.tar.gz nextcloud-server-898df41de968321926e10ad532a64c3915ddad29.zip |
Revert "Merge branch 'master' of github.com:nextcloud/server"
This reverts commit d9d60238c7aaab9c61bf2d50c15aa59bc88c8975, reversing
changes made to ba3fdb0cdcfbb84f0080a2146a4ba2f01569915d.
Diffstat (limited to 'apps/settings/lib/BackgroundJobs/VerifyUserData.php')
-rw-r--r-- | apps/settings/lib/BackgroundJobs/VerifyUserData.php | 60 |
1 files changed, 42 insertions, 18 deletions
diff --git a/apps/settings/lib/BackgroundJobs/VerifyUserData.php b/apps/settings/lib/BackgroundJobs/VerifyUserData.php index 122229fc8ab..a9fc1e19a7d 100644 --- a/apps/settings/lib/BackgroundJobs/VerifyUserData.php +++ b/apps/settings/lib/BackgroundJobs/VerifyUserData.php @@ -1,14 +1,10 @@ <?php - -declare(strict_types=1); - /** * @copyright Copyright (c) 2017 Bjoern Schiessle <bjoern@schiessle.org> * * @author Arthur Schiwon <blizzz@arthur-schiwon.de> * @author Bjoern Schiessle <bjoern@schiessle.org> * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Côme Chilliet <come.chilliet@nextcloud.com> * @author Joas Schilling <coding@schilljs.com> * @author Lukas Reschke <lukas@statuscode.ch> * @author Morris Jobke <hey@morrisjobke.de> @@ -41,37 +37,65 @@ use OCP\BackgroundJob\IJobList; use OCP\BackgroundJob\Job; use OCP\Http\Client\IClientService; use OCP\IConfig; +use OCP\ILogger; use OCP\IUserManager; -use Psr\Log\LoggerInterface; class VerifyUserData extends Job { + /** @var bool */ - private bool $retainJob = true; + private $retainJob = true; /** @var int max number of attempts to send the request */ - private int $maxTry = 24; + private $maxTry = 24; /** @var int how much time should be between two tries (1 hour) */ - private int $interval = 3600; - private string $lookupServerUrl; - - public function __construct( - private IAccountManager $accountManager, - private IUserManager $userManager, - private IClientService $httpClientService, - private LoggerInterface $logger, + private $interval = 3600; + + /** @var IAccountManager */ + private $accountManager; + + /** @var IUserManager */ + private $userManager; + + /** @var IClientService */ + private $httpClientService; + + /** @var ILogger */ + private $logger; + + /** @var string */ + private $lookupServerUrl; + + /** @var IConfig */ + private $config; + + public function __construct(IAccountManager $accountManager, + IUserManager $userManager, + IClientService $clientService, + ILogger $logger, ITimeFactory $timeFactory, - private IConfig $config, + IConfig $config ) { parent::__construct($timeFactory); + $this->accountManager = $accountManager; + $this->userManager = $userManager; + $this->httpClientService = $clientService; + $this->logger = $logger; $lookupServerUrl = $config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com'); $this->lookupServerUrl = rtrim($lookupServerUrl, '/'); + $this->config = $config; } - public function start(IJobList $jobList): void { + /** + * run the job, then remove it from the jobList + * + * @param IJobList $jobList + * @param ILogger|null $logger + */ + public function execute(IJobList $jobList, ILogger $logger = null) { if ($this->shouldRun($this->argument)) { - parent::start($jobList); + parent::execute($jobList, $logger); $jobList->remove($this, $this->argument); if ($this->retainJob) { $this->reAddJob($jobList, $this->argument); |