check loop fix

pull/10/head v0.28.2
Hunter Long 2018-06-30 15:37:01 -07:00
parent 9925b49a9c
commit 72a4fcff44
3 changed files with 6 additions and 2 deletions

View File

@ -18,7 +18,7 @@ services:
env:
global:
- VERSION=0.28.2
- VERSION=0.28.3
- DB_HOST=localhost
- DB_USER=travis
- DB_PASS=

View File

@ -1,6 +1,6 @@
FROM alpine:latest
ENV VERSION=v0.28.2
ENV VERSION=v0.28.3
RUN apk --no-cache add libstdc++ ca-certificates
RUN wget -q https://github.com/hunterlong/statup/releases/download/$VERSION/statup-linux-alpine.tar.gz && \

View File

@ -39,6 +39,10 @@ func (s *Service) Check() *Service {
Timeout: 30 * time.Second,
}
response, err := client.Get(s.Domain)
if err != nil {
s.Failure(fmt.Sprintf("HTTP Error %v", err))
return s
}
response.Header.Set("User-Agent", "StatupMonitor")
t2 := time.Now()
s.Latency = t2.Sub(t1).Seconds()