setAllowParallelRuns(false); } protected function run($argument): void { if (!$this->calendarFederationConfig->isFederationEnabled()) { return; } $id = $argument[self::ARGUMENT_ID] ?? null; if (!is_numeric($id)) { return; } $id = (int)$id; try { $calendar = $this->federatedCalendarMapper->find($id); } catch (DoesNotExistException $e) { return; } try { $this->syncService->syncOne($calendar); } catch (ClientExceptionInterface $e) { $name = $calendar->getUri(); $this->logger->error("Failed to sync federated calendar $name: " . $e->getMessage(), [ 'exception' => $e, 'calendar' => $calendar->toCalendarInfo(), ]); // Let the periodic background job pick up the calendar at a later point $calendar->setLastSync(1); $this->federatedCalendarMapper->update($calendar); } } }