accounting: write the current bwlimit to the log on SIGUSR2

This commit is contained in:
Nick Craig-Wood 2024-09-26 18:01:18 +01:00
parent 7d32da441e
commit 19458e8459

View File

@ -35,12 +35,13 @@ func (tb *tokenBucket) startSignalHandler() {
tb.toggledOff = !tb.toggledOff
tb.curr, tb.prev = tb.prev, tb.curr
s := "disabled"
s, limit := "disabled", "off"
if !tb.curr._isOff() {
s = "enabled"
limit = tb.currLimit.Bandwidth.String()
}
fs.Logf(nil, "Bandwidth limit %s by user", s)
fs.Logf(nil, "Bandwidth limit %s by user (now %s)", s, limit)
}()
}
}()