Skip to content

Commit

Permalink
Add /healthz endpoint (#3095)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko authored Jul 15, 2024
1 parent 3dcdf3d commit e6a712b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ import (
const MainnetChainId = 1
const RinkebyChainId = 4

func (s *LivepeerServer) healthzHandler() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
respondOk(w, nil)
})
}

// Status
func (s *LivepeerServer) statusHandler() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down
3 changes: 3 additions & 0 deletions server/mediaserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ func (s *LivepeerServer) StartMediaServer(ctx context.Context, httpAddr string)
// Store ctx to later use as cancel signal for watchdog goroutine
s.context = ctx

// health endpoint
s.HTTPMux.Handle("/healthz", s.healthzHandler())

//LPMS handlers for handling RTMP video
s.LPMS.HandleRTMPPublish(createRTMPStreamIDHandler(ctx, s, nil), gotRTMPStreamHandler(s), endRTMPStreamHandler(s))
s.LPMS.HandleRTMPPlay(getRTMPStreamHandler(s))
Expand Down

0 comments on commit e6a712b

Please sign in to comment.