Skip to content

Commit

Permalink
Add error logging for healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mizutani committed Aug 5, 2023
1 parent a8d378d commit d54e925
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/controller/server/healthcheck.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
package server

import "net/http"
import (
"net/http"

"github.com/m-mizutani/ghnotify/pkg/utils"
)

func handleHealthCheckRequest() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("OK"))
if _, err := w.Write([]byte("OK")); err != nil {
utils.Logger.Error("fail to write response", utils.ErrLog(err))
}
}
}

0 comments on commit d54e925

Please sign in to comment.