From 6ec85b96ad4fee6ec1767f6b78f92a38ce658a06 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sun, 24 Jan 2021 18:29:38 -0500 Subject: Allow the timeout to be adjusted --- cmd/main/http.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd/main/http.go') diff --git a/cmd/main/http.go b/cmd/main/http.go index 94d6ae5..fd6169e 100644 --- a/cmd/main/http.go +++ b/cmd/main/http.go @@ -12,9 +12,9 @@ type httpCheck struct { Code int } -func httpStatusWorker(jobs <-chan httpCheck, msg chan<- *jobResponse) { +func httpStatusWorker(jobs <-chan httpCheck, msg chan<- *jobResponse, timeout int) { for hc := range jobs { - err := checkup.HttpStatusOK(hc.URL, hc.Code) + err := checkup.HttpStatusOK(hc.URL, timeout, hc.Code) if err != nil { s := fmt.Sprintf("Checking: %s, %v", hc.URL, err) @@ -36,7 +36,7 @@ func checkStatus(conf *Config) map[string]*jobResponse { msgs := make(chan *jobResponse) for i := 1; i <= conf.Workers; i++ { - go httpStatusWorker(hc, msgs) + go httpStatusWorker(hc, msgs, conf.HTTPTimeout) } go func() { -- cgit v1.2.3