Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

fix: make /health endpoint trigger Chrome initialization for faster startup

Mariod1d4122d13f8
diff --git a/internal/handlers/health_tabs.go b/internal/handlers/health_tabs.go
index 5f44ea04..047aa7e3 100644
--- a/internal/handlers/health_tabs.go
+++ b/internal/handlers/health_tabs.go
@@ -15,6 +15,12 @@ func (h *Handlers) HandleHealth(w http.ResponseWriter, r *http.Request) {
return
}
+ // Ensure Chrome is initialized before checking health
+ if err := h.ensureChrome(); err != nil {
+ web.JSON(w, 503, map[string]any{"status": "error", "reason": fmt.Sprintf("chrome initialization failed: %v", err)})
+ return
+ }
+
targets, err := h.Bridge.ListTargets()
if err != nil {
web.JSON(w, 503, map[string]any{"status": "error", "reason": err.Error()})