addArgument('station', InputArgument::REQUIRED); } protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $stationName = $input->getArgument('station'); $station = $this->stationRepo->findByIdentifier($stationName); if (!($station instanceof Station)) { $io->error('Station not found.'); return 1; } $this->logger->pushProcessor( function ($record) use ($station) { $record['extra']['station'] = [ 'id' => $station->getId(), 'name' => $station->getName(), ]; return $record; } ); $this->logger->info('Starting Now Playing sync task.'); try { $this->buildQueueTask->run($station); } catch (Throwable $e) { $this->logger->error( 'Queue builder error: ' . $e->getMessage(), ['exception' => $e] ); } try { $this->nowPlayingTask->run($station); } catch (Throwable $e) { $this->logger->error( 'Now Playing error: ' . $e->getMessage(), ['exception' => $e] ); } $this->logger->info('Now Playing sync task complete.'); $this->logger->popProcessor(); return 0; } }