Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Return 502 from health endpoint on shutdown #323

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

- Rename the frame drop issue title. ([#315](https://github.com/getsentry/vroom/pull/315))
- Add new endpoint for regressed functions. ([#318](https://github.com/getsentry/vroom/pull/318))
- Return 502 from health endpoint on shutdown. ([#323](https://github.com/getsentry/vroom/pull/323))

## 23.9.1

Expand Down
6 changes: 5 additions & 1 deletion cmd/vroom/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ func main() {
}

func (e *environment) getHealth(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusNoContent)
if _, err := os.Stat("/tmp/vroom.down"); err == nil {
w.WriteHeader(http.StatusNoContent)
} else {
w.WriteHeader(http.StatusBadGateway)
}
}

type Filter struct {
Expand Down