mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-25 07:58:28 +00:00
discosrv: Clean up debug logging
This commit is contained in:
parent
545025ed2b
commit
b92df85893
@ -107,16 +107,14 @@ func limit(addr *net.UDPAddr) bool {
|
|||||||
if bkt.TakeAvailable(1) != 1 {
|
if bkt.TakeAvailable(1) != 1 {
|
||||||
// Rate limit exceeded; ignore packet
|
// Rate limit exceeded; ignore packet
|
||||||
if debug {
|
if debug {
|
||||||
log.Printf("Rate limit exceeded for", key)
|
log.Println("Rate limit exceeded for", key)
|
||||||
}
|
}
|
||||||
limited++
|
limited++
|
||||||
return true
|
return true
|
||||||
} else if debug {
|
|
||||||
log.Printf("Rate limit OK for", key)
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if debug {
|
if debug {
|
||||||
log.Printf("New limiter for", key)
|
log.Println("New limiter for", key)
|
||||||
}
|
}
|
||||||
// One packet per ten seconds average rate, burst ten packets
|
// One packet per ten seconds average rate, burst ten packets
|
||||||
limiter.Add(key, ratelimit.NewBucket(10*time.Second, 10))
|
limiter.Add(key, ratelimit.NewBucket(10*time.Second, 10))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user