Skip to content

Commit

Permalink
Fix typos in healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
swift1337 committed Nov 22, 2024
1 parent b5c367a commit 3a856c2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions zetaclient/tss/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ func HealthcheckWorker(ctx context.Context, server *tss.TssServer, p Healthcheck

pinger := func(ctx context.Context, _ *ticker.Ticker) error {
var wg sync.WaitGroup
for i := range p.WhitelistPeers {
peerID := p.WhitelistPeers[i]
for _, peerID := range p.WhitelistPeers {
if peerID == host.ID() {
continue
}

wg.Add(1)

go func() {
go func(peerID peer.ID) {
defer wg.Done()

defer func() {
Expand All @@ -81,12 +80,12 @@ func HealthcheckWorker(ctx context.Context, server *tss.TssServer, p Healthcheck
mu.Lock()
pingRTT[peerID] = result.RTT.Nanoseconds()
mu.Unlock()
}()

wg.Wait()
p.Telemetry.SetPingRTT(pingRTT)
}(peerID)
}

wg.Wait()
p.Telemetry.SetPingRTT(pingRTT)

return nil
}

Expand Down

0 comments on commit 3a856c2

Please sign in to comment.