mirror of
https://github.com/nadoo/glider.git
synced 2026-11-23 23:49:41 +08:00
check: stop current check process when timeout (#159)
This commit is contained in:
1 parent
061b3da42e
commit
3392db41de
3 files changed
+14
-7
No files matched your search
@@ -252,6 +252,8 @@ func checkWebSite(fwdr *Forwarder, website string, timeout time.Duration, buf []
|
||||
}
|
||||
defer rc.Close()
|
||||
|
||||
rc.SetDeadline(time.Now().Add(timeout))
|
||||
|
||||
_, err = rc.Write([]byte("GET / HTTP/1.0\r\n\r\n"))
|
||||
if err != nil {
|
||||
fwdr.Disable()
|
||||
|
||||
Reference in new issue
Block a user