Skip to content

Commit

Permalink
chore(monitor/routerecon): reduce rate limit issues (#2161)
Browse files Browse the repository at this point in the history
Reduce routescan recon loop frequency to mitigate rate limit errors.

issue: none
  • Loading branch information
corverroos authored Oct 14, 2024
1 parent 5ac2eeb commit 4b2464e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion monitor/routerecon/recon.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func ReconForever(ctx context.Context, network netconf.Network, xprov xchain.Pro
return
}

ticker := time.NewTicker(time.Minute * 10) // RouteScan rate limits prevent faster recon.
ticker := time.NewTicker(time.Minute * 30) // RouteScan rate limits prevent faster recon.
defer ticker.Stop()

for {
Expand All @@ -44,6 +44,14 @@ func ReconForever(ctx context.Context, network netconf.Network, xprov xchain.Pro
reconSuccess.Inc()
log.Info(ctx, "RouteRecon success", "stream", network.StreamName(stream))
}

// Sleep to avoid rate limiting.
select {
case <-ctx.Done():
return
case <-time.After(time.Minute):
// Continue
}
}
}
}
Expand Down

0 comments on commit 4b2464e

Please sign in to comment.