golangci-lint: use forbidigo to block time.Sleep (#2946)

This commit is contained in:
Kristoffer Dalby 2025-12-10 17:45:59 +01:00 committed by GitHub
parent 0e1673041c
commit 87bd67318b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 313 additions and 181 deletions

View file

@ -364,7 +364,13 @@ func serverSTUNListener(ctx context.Context, packetConn *net.UDPConn) {
return
}
log.Error().Caller().Err(err).Msgf("STUN ReadFrom")
time.Sleep(time.Second)
// Rate limit error logging - wait before retrying, but respect context cancellation
select {
case <-ctx.Done():
return
case <-time.After(time.Second):
}
continue
}