Browse Source

fix 1 nanosecond active health check :X

master
forest 2 months ago
parent
commit
c0deebd174
2 changed files with 4 additions and 2 deletions
  1. +1
    -1
      cachingproxy/build-docker.sh
  2. +3
    -1
      cachingproxy/main.go

+ 1
- 1
cachingproxy/build-docker.sh View File

@ -1,5 +1,5 @@
#!/bin/bash -e
VERSION="0.0.15"
VERSION="0.0.17"
rm -rf dockerbuild || true
mkdir dockerbuild
cp Dockerfile dockerbuild/Dockerfile-amd64


+ 3
- 1
cachingproxy/main.go View File

@ -91,6 +91,7 @@ func main() {
newRequest.Header.Add(k, v)
}
}
//log.Println("proxyRequest")
response, err := client.Do(newRequest)
if err != nil {
if debug {
@ -242,6 +243,7 @@ func main() {
go (func() {
for {
//log.Println("active health request")
response, err := client.Get(fmt.Sprintf("http://%s", backend))
mutex.Lock()
if err != nil || response.StatusCode != 200 {
@ -258,7 +260,7 @@ func main() {
}
}
mutex.Unlock()
time.Sleep(1)
time.Sleep(time.Second * time.Duration(5))
}
})()


Loading…
Cancel
Save