Skip to content

Commit

Permalink
Timed healthcheck.
Browse files Browse the repository at this point in the history
  • Loading branch information
BerniVarga committed Jan 18, 2018
1 parent 6cd049a commit bb4a5c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/gorilla/mux"
"github.com/jawher/mow.cli"
"github.com/rcrowley/go-metrics"
"time"
)

const appDescription = "Reads Splunk events via the Splunk REST API"
Expand Down Expand Up @@ -91,7 +92,16 @@ func routeRequests(splunkService SplunkServiceI, healthService *healthService, p

serveMux := http.NewServeMux()

hc := health.HealthCheck{SystemCode: healthService.config.appSystemCode, Name: healthService.config.appName, Description: appDescription, Checks: healthService.checks}
hc := health.TimedHealthCheck{
HealthCheck: health.HealthCheck{
SystemCode: healthService.config.appSystemCode,
Name: healthService.config.appName,
Description: appDescription,
Checks: healthService.checks,
},
Timeout: 10 * time.Second,
}

serveMux.HandleFunc(healthPath, health.Handler(hc))
serveMux.HandleFunc(status.GTGPath, status.NewGoodToGoHandler(healthService.gtgCheck))
serveMux.HandleFunc(status.BuildInfoPath, status.BuildInfoHandler)
Expand Down
6 changes: 3 additions & 3 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"ignore": "test",
"package": [
{
"checksumSHA1": "fNgRM8ZlaDzdvSpuhSdGxEOrWi4=",
"checksumSHA1": "G8lW8pPVLieqh/MTJZkvI/i/WyM=",
"path": "github.com/Financial-Times/go-fthealth/v1_1",
"revision": "e7ccca038327a0091303a52445ec1f0fb66cb97b",
"revisionTime": "2017-05-25T09:50:41Z"
"revision": "1b007e2b37b7936dfb6671fa17e5a29fd35a08ea",
"revisionTime": "2017-12-04T12:48:31Z"
},
{
"checksumSHA1": "zUpINnstJChGK0LAtkt7jBc3RY0=",
Expand Down

0 comments on commit bb4a5c8

Please sign in to comment.