Commit 034506ec authored by Kevin Lyda's avatar Kevin Lyda 💬
Browse files

Check Volts each page load.

parent d3ea36bc
Pipeline #1224 passed with stage
in 1 minute and 7 seconds
...@@ -36,6 +36,7 @@ var indexPg indexPage ...@@ -36,6 +36,7 @@ var indexPg indexPage
func indexHandler(w http.ResponseWriter, r *http.Request) { func indexHandler(w http.ResponseWriter, r *http.Request) {
indexPg.CPM, _ = gc.GetCPM() indexPg.CPM, _ = gc.GetCPM()
indexPg.Volts, _ = gc.Volts()
t, err := template.ParseFiles(path.Join(*templateDir, "index.html")) t, err := template.ParseFiles(path.Join(*templateDir, "index.html"))
if err != nil { if err != nil {
log.Printf("Template error: %s\n", err) log.Printf("Template error: %s\n", err)
...@@ -50,7 +51,6 @@ func main() { ...@@ -50,7 +51,6 @@ func main() {
indexPg.Model = gc.Model() indexPg.Model = gc.Model()
indexPg.Version = gc.Version() indexPg.Version = gc.Version()
indexPg.Serial = gc.Serial() indexPg.Serial = gc.Serial()
indexPg.Volts, _ = gc.Volts()
http.HandleFunc("/", indexHandler) http.HandleFunc("/", indexHandler)
http.Handle("/metrics", promhttp.Handler()) http.Handle("/metrics", promhttp.Handler())
log.Fatal(http.ListenAndServe(*addr, nil)) log.Fatal(http.ListenAndServe(*addr, nil))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment