diff --git a/controller/api/handlers/invoke-function.go b/controller/api/handlers/invoke-function.go index 4c1e55e..2eaa4f3 100644 --- a/controller/api/handlers/invoke-function.go +++ b/controller/api/handlers/invoke-function.go @@ -60,7 +60,7 @@ func InvokeFunctionHandler(s state.State, orch orchestration.Orchestrator) gin.H healthcheck := instance.Endpoint.String() + "/_/health" for i := 0; i < maxHealthcheckRetries; i++ { log.Debugf("Performing healthcheck request on Alpha: %s", healthcheck) - if _, err := http.Get(healthcheck); err != nil { + if res, err := http.Get(healthcheck); err != nil || res.StatusCode != http.StatusOK { if i == maxHealthcheckRetries-1 { log.Errorf("failed to perform healthcheck on Alpha: %v", err) c.JSON(http.StatusServiceUnavailable, makeApiError(ErrFunctionCantBeMarkedAsHealthy))