Skip to content

Commit

Permalink
Merge pull request #39005 from nextcloud/fix/dav/upgrade-catch-sab-sy…
Browse files Browse the repository at this point in the history
…nc-errors

fix(dav): Catch SAB sync errors during upgrade
  • Loading branch information
szaimen authored Jun 27, 2023
2 parents 4cfab4b + 92c18b2 commit 06c99e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/dav/lib/Migration/Version1027Date20230504122946.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Log\LoggerInterface;
use Throwable;

class Version1027Date20230504122946 extends SimpleMigrationStep {
private SyncService $syncService;
Expand All @@ -49,6 +50,13 @@ public function __construct(SyncService $syncService, LoggerInterface $logger) {
* @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');
}
}
}

0 comments on commit 06c99e0

Please sign in to comment.