specrails-hub 1.8.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -715,12 +715,17 @@ async function hubStart(port) {
715
715
  catch { /* ignore */ }
716
716
  }
717
717
  child.unref();
718
- // Wait for server to be ready (longer window for slow machines)
719
- await new Promise((resolve) => setTimeout(resolve, 2000));
720
- const detection = await detectWebManager(port);
721
- if (detection.running) {
722
- cliLog(`hub started on http://127.0.0.1:${port}`);
723
- return 0;
718
+ // Poll until the server is ready (up to 15 seconds, checking every 300ms)
719
+ const pollTimeoutMs = 15000;
720
+ const pollIntervalMs = 300;
721
+ const startPoll = Date.now();
722
+ while (Date.now() - startPoll < pollTimeoutMs) {
723
+ await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
724
+ const detection = await detectWebManager(port);
725
+ if (detection.running) {
726
+ cliLog(`hub started on http://127.0.0.1:${port}`);
727
+ return 0;
728
+ }
724
729
  }
725
730
  cliError(`hub failed to start — logs: ${HUB_LOG_FILE}`);
726
731
  return 1;