Skip to content

Commit

Permalink
skip block notification if latency is too high
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Dec 10, 2024
1 parent 1d59688 commit c5a6e73
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion zetaclient/orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,15 @@ func (oc *Orchestrator) runScheduler(ctx context.Context) error {
bn := newBlock.Block.Height

blockTimeLatency := time.Since(newBlock.Block.Time)
metrics.CoreBlockLatency.Set(blockTimeLatency.Seconds())
blockTimeLatencySeconds := blockTimeLatency.Seconds()
metrics.CoreBlockLatency.Set(blockTimeLatencySeconds)

if blockTimeLatencySeconds > 15 {
oc.logger.Warn().
Float64("latency", blockTimeLatencySeconds).
Msgf("runScheduler: core block latency too high")
continue

Check warning on line 318 in zetaclient/orchestrator/orchestrator.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/orchestrator/orchestrator.go#L302-L318

Added lines #L302 - L318 were not covered by tests
}

balance, err := oc.zetacoreClient.GetZetaHotKeyBalance(ctx)
if err != nil {
Expand Down

0 comments on commit c5a6e73

Please sign in to comment.