Skip to content

Commit

Permalink
close the connection on each healthcheck to fix - too many open files…
Browse files Browse the repository at this point in the history
… error

Signed-off-by: Krasi Georgiev <krasi.root@gmail.com>
  • Loading branch information
krasi-georgiev committed May 25, 2017
1 parent be29383 commit 6a25629
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ func main() {
}
for {
time.Sleep(interval / 3)
_, err := http.Get("http://127.0.0.1:" + srvConfig.Port)
res, err := http.Get("http://127.0.0.1:" + srvConfig.Port)
if err == nil {
daemon.SdNotify(false, "WATCHDOG=1")
} else {
log.Printf("RPi Controller watchdog error: %v", err)
}
res.Body.Close()
}
}()
return shutdown(quit, srv)
Expand Down

0 comments on commit 6a25629

Please sign in to comment.