aboutsummaryrefslogtreecommitdiff
path: root/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 /http.go
parent9c8cc14958c248ddba1669becb5e026d43dd997c (diff)
downloadcheckup-6ec85b96ad4fee6ec1767f6b78f92a38ce658a06.tar.gz
checkup-6ec85b96ad4fee6ec1767f6b78f92a38ce658a06.tar.xz
Allow the timeout to be adjusted
Diffstat (limited to 'http.go')
-rw-r--r--http.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/http.go b/http.go
index 24e0b4d..daf8945 100644
--- a/http.go
+++ b/http.go
@@ -6,8 +6,8 @@ import (
"time"
)
-func HttpStatusOK(url string, status int) error {
- client := &http.Client{Timeout: 5 * time.Second}
+func HttpStatusOK(url string, timeout, status int) error {
+ client := &http.Client{Timeout: time.Duration(timeout) * time.Second}
resp, err := client.Get(url)