aboutsummaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2021-01-24 12:26:02 -0500
committerMitch Riedstra <mitch@riedstra.us>2021-01-24 12:26:02 -0500
commitbad568d0a26ad348f25a4556266ba98f73b3be02 (patch)
tree6eb909e37d7b65472381a17362283b6765adfc14 /http.go
parent0539b119a4c205a96590b356849215b6e1b1ed35 (diff)
downloadcheckup-bad568d0a26ad348f25a4556266ba98f73b3be02.tar.gz
checkup-bad568d0a26ad348f25a4556266ba98f73b3be02.tar.xz
Run requests concurrently
Diffstat (limited to 'http.go')
-rw-r--r--http.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/http.go b/http.go
index f3a910f..24e0b4d 100644
--- a/http.go
+++ b/http.go
@@ -3,10 +3,13 @@ package checkup
import (
"fmt"
"net/http"
+ "time"
)
func HttpStatusOK(url string, status int) error {
- resp, err := http.Get(url)
+ client := &http.Client{Timeout: 5 * time.Second}
+
+ resp, err := client.Get(url)
if err != nil {
return err