Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1408 from hyperledger/return-status-from-health
Browse files Browse the repository at this point in the history
Return status from health check
  • Loading branch information
Silas Davis authored Jan 26, 2021
2 parents 709b875 + cd84812 commit b27d0ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vent/service/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package service

import (
"context"
"encoding/json"
"net/http"

"github.com/hyperledger/burrow/logging"
Expand Down Expand Up @@ -70,6 +71,11 @@ func healthHandler(consumer *Consumer) func(resp http.ResponseWriter, req *http.
resp.WriteHeader(http.StatusServiceUnavailable)
} else {
resp.WriteHeader(http.StatusOK)
bs, err := json.Marshal(consumer.statusMessage())
if err == nil {
resp.Header().Set("Content-Type", "application/json")
resp.Write(bs)
}
}
}
}

0 comments on commit b27d0ff

Please sign in to comment.