option('interval') ?: config('streaming.viewer_sync_interval', 2))); if ($this->option('once')) { $this->syncOnce($viewerCounts); return self::SUCCESS; } while (true) { try { $this->syncOnce($viewerCounts); } catch (Throwable $exception) { report($exception); $this->components->error($exception->getMessage()); } sleep($interval); } return self::SUCCESS; } private function syncOnce(MediaMtxViewerCountSynchronizer $viewerCounts): void { $result = $viewerCounts->sync(); if ($this->output->isVerbose()) { $this->components->info( "Synced {$result['viewers']} viewers across {$result['channels']} live channels.", ); } } }