summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-10-29 10:57:25 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-10-29 10:57:25 +0100
commiteb5fd3127f3d557cc9771756c400baf4d12d2b4e (patch)
treeca2993f57ce31e18b29923ae6395f3308cde9024
parent3ed28e4bfe2d333fdf1ca2434b57cfc10c3d9791 (diff)
Revert "modules: Adjust the log throttle logic a little"
-rw-r--r--modules/client.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/client.go b/modules/client.go
index 9a0415632..b3dad498b 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -106,18 +106,16 @@ func NewClient(cfg ClientConfig) *Client {
var throttleSince time.Time
throttle := func(f func()) {
- // Skip the first call.
- // This is used for "download" etc. and we want to avoid
- // logging anything if it is fast.
if throttleSince.IsZero() {
throttleSince = time.Now()
+ f()
return
}
if time.Since(throttleSince) < 6*time.Second {
return
}
- f()
throttleSince = time.Now()
+ f()
}
return &Client{