Skip to content

Commit

Permalink
Merge pull request #39028 from nextcloud/backport/39005/stable27
Browse files Browse the repository at this point in the history
[stable27] fix(dav): Catch SAB sync errors during upgrade
  • Loading branch information
szaimen authored Jun 27, 2023
2 parents ff04de6 + 0fd478b commit 50f1fc0
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 50f1fc0

Please sign in to comment.