diff --git a/lib/private/Repair.php b/lib/private/Repair.php index 5201c88de7..2ab3a57e82 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -149,7 +149,7 @@ class Repair implements IOutput { new AddCleanupUpdaterBackupsJob(\OC::$server->getJobList()), new RepairPendingCronJobs(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()), new SetVcardDatabaseUID(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig(), \OC::$server->getLogger()), - new CleanupCardDAVPhotoCache(\OC::$server->getConfig(), \OC::$server->getAppDataDir('dav-photocache')), + new CleanupCardDAVPhotoCache(\OC::$server->getConfig(), \OC::$server->getAppDataDir('dav-photocache'), \OC::$server->getLogger()), ]; } diff --git a/lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php b/lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php index 11bb765e9a..c9c7b5cf1c 100644 --- a/lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php +++ b/lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php @@ -22,11 +22,11 @@ declare(strict_types=1); namespace OC\Repair\NC16; -use OC\Files\AppData\AppData; use OCP\Files\IAppData; use OCP\Files\NotFoundException; use OCP\Files\SimpleFS\ISimpleFolder; use OCP\IConfig; +use OCP\ILogger; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; @@ -44,12 +44,16 @@ class CleanupCardDAVPhotoCache implements IRepairStep { /** @var IConfig */ private $config; - /** @var AppData */ + /** @var IAppData */ private $appData; - public function __construct(IConfig $config, IAppData $appData) { + /** @var ILogger */ + private $logger; + + public function __construct(IConfig $config, IAppData $appData, ILogger $logger) { $this->config = $config; $this->appData = $appData; + $this->logger = $logger; } public function getName(): string { @@ -78,7 +82,8 @@ class CleanupCardDAVPhotoCache implements IRepairStep { /** @var ISimpleFolder $folder */ $folder->getFile('photo.')->delete(); } catch (\Exception $e) { - $output->warning('Could not delete "photo." file in dav-photocache/' . $folder->getName()); + $this->logger->logException($e); + $output->warning('Could not delete file "dav-photocache/' . $folder->getName() . '/photo."'); } } }