diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-02-06 11:22:09 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-02-08 10:28:29 +0100 |
commit | 166773879ba20bf7b81f3996a7c4e2a9ff7ee16d (patch) | |
tree | ee8c3115167e71c115f56479612be08c574761f1 /apps/settings/lib | |
parent | 9e9040196f94e9650ce847e9feb9f23ad8d19ada (diff) | |
download | nextcloud-server-166773879ba20bf7b81f3996a7c4e2a9ff7ee16d.tar.gz nextcloud-server-166773879ba20bf7b81f3996a7c4e2a9ff7ee16d.zip |
fix!: Migrate jobs away from deprecated interfaces
BREAKING CHANGE: Removed ILogFactory::getCustomLogger deprecated method
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/settings/lib')
-rw-r--r-- | apps/settings/lib/BackgroundJobs/VerifyUserData.php | 60 |
1 files changed, 18 insertions, 42 deletions
diff --git a/apps/settings/lib/BackgroundJobs/VerifyUserData.php b/apps/settings/lib/BackgroundJobs/VerifyUserData.php index a9fc1e19a7d..122229fc8ab 100644 --- a/apps/settings/lib/BackgroundJobs/VerifyUserData.php +++ b/apps/settings/lib/BackgroundJobs/VerifyUserData.php @@ -1,10 +1,14 @@ <?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> @@ -37,65 +41,37 @@ 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 $retainJob = true; + private bool $retainJob = true; /** @var int max number of attempts to send the request */ - private $maxTry = 24; + private int $maxTry = 24; /** @var int how much time should be between two tries (1 hour) */ - 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, + private int $interval = 3600; + private string $lookupServerUrl; + + public function __construct( + private IAccountManager $accountManager, + private IUserManager $userManager, + private IClientService $httpClientService, + private LoggerInterface $logger, ITimeFactory $timeFactory, - IConfig $config + private 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; } - /** - * run the job, then remove it from the jobList - * - * @param IJobList $jobList - * @param ILogger|null $logger - */ - public function execute(IJobList $jobList, ILogger $logger = null) { + public function start(IJobList $jobList): void { if ($this->shouldRun($this->argument)) { - parent::execute($jobList, $logger); + parent::start($jobList); $jobList->remove($this, $this->argument); if ($this->retainJob) { $this->reAddJob($jobList, $this->argument); |