perf: scan interval 50ms fixed

HL allMids pushes ~200ms, scan at 50ms catches every update
within 1 tick. Async entry goroutine means no blocking.
This commit is contained in:
jackyu66git
2026-05-03 22:47:44 +08:00
parent 721abc02a9
commit b55ff111a4
2 changed files with 6 additions and 7 deletions
+3 -3
View File
@@ -115,15 +115,15 @@ func main() {
// Main loop
lastHour := -1
// Random jitter 50-250ms to avoid lock-step with exchange push cycles
jitterMin, jitterMax := 50, 250
// Fixed 50ms scan interval
jitterMin, jitterMax := 50, 50
randInterval := func() time.Duration {
return time.Duration(jitterMin+rand.Intn(jitterMax-jitterMin+1)) * time.Millisecond
}
scannerTick := time.NewTimer(randInterval())
statusTick := time.NewTicker(30 * time.Second)
log.Printf("[Monitor] Scanner running every %d-%dms (random jitter)", jitterMin, jitterMax)
log.Printf("[Monitor] Scanner running every %dms", jitterMin)
runLoop := true
for runLoop {