mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 22:16:02 +00:00
Revert "modules: Adjust the log throttle logic a little"
This reverts commit 3f64b5a3de.
This commit is contained in:
1 file changed
+2
-4
+2
-4
@@ -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{
|
||||
|
||||
Reference in new issue
Block a user