Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit 985a90f

Browse files
author
David Ansermino
authored
Fix health check (#10)
1 parent 96232ad commit 985a90f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

metrics/health/health.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ func (s httpMetricServer) HealthStatus(w http.ResponseWriter, _ *http.Request) {
6767
timeDiff := now.Sub(prev.LastUpdated)
6868
// If block has changed, update it
6969
if current.Height.Cmp(prev.Height) == 1 {
70-
s.stats[chain.Id()].LastUpdated = current.LastUpdated
71-
s.stats[chain.Id()].Height = current.Height
70+
s.stats[i].LastUpdated = current.LastUpdated
71+
s.stats[i].Height = current.Height
7272
} else if int(timeDiff.Seconds()) >= s.timeDelay { // Error if we exceeded the time limit
7373
response := &httpResponse{
7474
Chains: []ChainInfo{},

0 commit comments

Comments
 (0)