die if webserver dies
This commit is contained in:
parent
1507dcc158
commit
833dcb07f6
1 changed files with 3 additions and 1 deletions
4
main.go
4
main.go
|
@ -139,7 +139,9 @@ func main() {
|
||||||
client := modbus.NewClient(handler)
|
client := modbus.NewClient(handler)
|
||||||
scrape(client)
|
scrape(client)
|
||||||
// Start http interface only after first successful scrape
|
// Start http interface only after first successful scrape
|
||||||
go http.ListenAndServe(*httpAddr, nil)
|
go func() {
|
||||||
|
die("http.ListenAndServe: %v", http.ListenAndServe(*httpAddr, nil))
|
||||||
|
}()
|
||||||
for range time.Tick(*scrapeInterval) {
|
for range time.Tick(*scrapeInterval) {
|
||||||
scrape(client)
|
scrape(client)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue