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 /core | |
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 'core')
-rw-r--r-- | core/Command/Background/Job.php | 4 | ||||
-rw-r--r-- | core/ajax/update.php | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/core/Command/Background/Job.php b/core/Command/Background/Job.php index aeee60bd6a5..b27686a6824 100644 --- a/core/Command/Background/Job.php +++ b/core/Command/Background/Job.php @@ -27,7 +27,6 @@ namespace OC\Core\Command\Background; use OCP\BackgroundJob\IJob; use OCP\BackgroundJob\IJobList; -use OCP\ILogger; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -37,7 +36,6 @@ use Symfony\Component\Console\Output\OutputInterface; class Job extends Command { public function __construct( protected IJobList $jobList, - protected ILogger $logger, ) { parent::__construct(); } @@ -86,7 +84,7 @@ class Job extends Command { $output->writeln('<error>Something went wrong when trying to retrieve Job with ID ' . $jobId . ' from database</error>'); return 1; } - $job->execute($this->jobList, $this->logger); + $job->start($this->jobList); $job = $this->jobList->getById($jobId); if (($job === null) || ($lastRun !== $job->getLastRun())) { diff --git a/core/ajax/update.php b/core/ajax/update.php index a826b6b7e7a..63d1bd3cf5e 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -43,8 +43,8 @@ use OCP\EventDispatcher\IEventDispatcher; use OCP\IEventSource; use OCP\IEventSourceFactory; use OCP\IL10N; -use OCP\ILogger; use OCP\L10N\IFactory; +use Psr\Log\LoggerInterface; if (!str_contains(@ini_get('disable_functions'), 'set_time_limit')) { @set_time_limit(0); @@ -186,10 +186,12 @@ if (\OCP\Util::needUpgrade()) { try { $updater->upgrade(); } catch (\Exception $e) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::ERROR, - 'app' => 'update', - ]); + \OCP\Server::get(LoggerInterface::class)->error( + $e->getMessage(), + [ + 'exception' => $e, + 'app' => 'update', + ]); $eventSource->send('failure', get_class($e) . ': ' . $e->getMessage()); $eventSource->close(); exit(); |