Skip to content

Commit

Permalink
returned check on healthy
Browse files Browse the repository at this point in the history
  • Loading branch information
almostinf committed Sep 12, 2023
1 parent 92d0b46 commit 856b735
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions api/handler/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,13 @@ func health(router chi.Router) {
// @failure 500 {object} api.ErrorInternalServerExample "Internal server error"
// @router /health/notifier [get]
func getNotifierState(writer http.ResponseWriter, request *http.Request) {
// state, err := controller.GetNotifierState(database)
// if err != nil {
// render.Render(writer, request, err) //nolint
// return
// }

notifierState := &dto.NotifierState{
State: "ERROR",
Message: "Something unexpected happened to Moira, so we temporarily turned off the notification mailing. We are already working on the problem and will fix it in the near future.",
state, err := controller.GetNotifierState(database)
if err != nil {
render.Render(writer, request, err) //nolint
return
}

if err := render.Render(writer, request, notifierState); err != nil {
if err := render.Render(writer, request, state); err != nil {
render.Render(writer, request, api.ErrorRender(err)) //nolint
return
}
Expand Down

0 comments on commit 856b735

Please sign in to comment.