Skip to content

Commit

Permalink
Healthcheck timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
BerniVarga committed Jan 11, 2018
1 parent 1ee5064 commit c742e3e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
15 changes: 10 additions & 5 deletions healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"github.com/Financial-Times/message-queue-go-producer/producer"
"github.com/Financial-Times/message-queue-gonsumer/consumer"
"github.com/Financial-Times/service-status-go/gtg"

"time"
)

type HealthCheck struct {
Expand All @@ -29,11 +31,14 @@ func NewHealthCheck(p producer.MessageProducer, c consumer.MessageConsumer, appN

func (h *HealthCheck) Health() func(w http.ResponseWriter, r *http.Request) {
checks := []fthealth.Check{h.readQueueCheck(), h.writeQueueCheck()}
hc := fthealth.HealthCheck{
SystemCode: h.appSystemCode,
Name: h.appName,
Description: serviceDescription,
Checks: checks,
hc := fthealth.TimedHealthCheck{
HealthCheck: fthealth.HealthCheck{
SystemCode: h.appSystemCode,
Name: h.appName,
Description: serviceDescription,
Checks: checks,
},
Timeout: 10 * time.Second,
}
return fthealth.Handler(hc)
}
Expand Down
12 changes: 6 additions & 6 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"ignore": "test",
"package": [
{
"checksumSHA1": "2dtgENfeO6SICvxjruwb9f1CzLY=",
"checksumSHA1": "G8lW8pPVLieqh/MTJZkvI/i/WyM=",
"path": "github.com/Financial-Times/go-fthealth/v1_1",
"revision": "bc27ed19189994eef0364e4a07879d5a3f3be76f",
"revisionTime": "2017-03-24T12:21:32Z",
"version": "0.2.0",
"versionExact": "0.2.0"
"revision": "1b007e2b37b7936dfb6671fa17e5a29fd35a08ea",
"revisionTime": "2017-12-04T12:48:31Z",
"version": "0.4",
"versionExact": "0.4.0"
},
{
"checksumSHA1": "GrgODPqXv7QebQjfjrxMHctK0wE=",
Expand Down Expand Up @@ -121,7 +121,7 @@
"revisionTime": "2017-05-05T19:16:46Z"
},
{
"checksumSHA1": "ArDa4bMPKzhiS1I7iioemBwZ6tE=",
"checksumSHA1": "jRiEa4gFPrOdh1x6aqm7kXAXMWo=",
"path": "golang.org/x/sys/unix",
"revision": "f3918c30c5c2cb527c0b071a27c35120a6c0719a",
"revisionTime": "2017-04-05T16:58:12Z"
Expand Down

0 comments on commit c742e3e

Please sign in to comment.