]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(dav): Catch SAB sync errors during upgrade 39005/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Mon, 26 Jun 2023 08:52:07 +0000 (10:52 +0200)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Mon, 26 Jun 2023 08:52:07 +0000 (10:52 +0200)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
apps/dav/lib/Migration/Version1027Date20230504122946.php

index e9ae174f56e2bbc6930a4704ec2ebdc2431e0cab..be3d19e8a80daba64c7921cad0f7782177fd28c1 100644 (file)
@@ -34,6 +34,7 @@ use OCP\Migration\SimpleMigrationStep;
 use Psr\Container\ContainerExceptionInterface;
 use Psr\Container\NotFoundExceptionInterface;
 use Psr\Log\LoggerInterface;
+use Throwable;
 
 class Version1027Date20230504122946 extends SimpleMigrationStep {
        private SyncService $syncService;
@@ -49,6 +50,13 @@ class Version1027Date20230504122946 extends SimpleMigrationStep {
         * @param array $options
         */
        public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
-               $this->syncService->syncInstance();
+               try {
+                       $this->syncService->syncInstance();
+               } catch (Throwable $e) {
+                       $this->logger->error('Could not sync system address books during update', [
+                               'exception' => $e,
+                       ]);
+                       $output->warning('System address book sync failed. See logs for details');
+               }
        }
 }