Skip to content

Commit

Permalink
fix: Close health check response body
Browse files Browse the repository at this point in the history
  • Loading branch information
romshark committed Jan 13, 2025
1 parent c034b89 commit 560a97d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,13 @@ func runAppLauncher(
log.Errorf("initializing preflight request: %v", err)
continue
}
_, err = healthCheckClient.Do(r)
resp, err := healthCheckClient.Do(r)
if err == nil {
log.Debugf("health check: OK, " +
"app server is ready to receive requests")
break // Server is ready to receive requests
}
resp.Body.Close()
log.Debugf("health check: err: %v", err)
if code := exitCode.Load(); code != -1 && code != 0 {
log.Errorf("health check: app server exited with exit code %d", code)
Expand Down

0 comments on commit 560a97d

Please sign in to comment.