Skip to content

Commit

Permalink
Merge pull request #323 from getsentry/txiao/chore/return-502-from-he…
Browse files Browse the repository at this point in the history
…alth-endpoint-on-shutdown

chore: Return 502 from health endpoint on shutdown
  • Loading branch information
Zylphrex authored Sep 27, 2023
2 parents b248a9d + 2d78a9e commit 3a6587a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit 3a6587a

Please sign in to comment.