aboutsummaryrefslogtreecommitdiff
path: root/cmd/main/http.go
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2021-01-24 18:29:38 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2021-01-24 18:29:38 -0500
commit6ec85b96ad4fee6ec1767f6b78f92a38ce658a06 (patch)
tree520dc1c0055a44370c4aaa61fc4daaec8af16090 /cmd/main/http.go
parent9c8cc14958c248ddba1669becb5e026d43dd997c (diff)
downloadcheckup-6ec85b96ad4fee6ec1767f6b78f92a38ce658a06.tar.gz
checkup-6ec85b96ad4fee6ec1767f6b78f92a38ce658a06.tar.xz
Allow the timeout to be adjusted
Diffstat (limited to 'cmd/main/http.go')
-rw-r--r--cmd/main/http.go6
1 files changed, 3 insertions, 3 deletions
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() {