Skip to content

Commit 1e6fdad

Browse files
committed
mcp: use rate.Every for idiomatic rate limiting
Replace rate.Limit(1.0/opts.MinInterval.Seconds()) with rate.Every(opts.MinInterval) which is the idiomatic way to express a rate from a duration. Also fix gofmt alignment in LoggingHandler struct.
1 parent 3034c9c commit 1e6fdad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mcp/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type LoggingHandler struct {
8888
mu *sync.Mutex
8989
limiter *rate.Limiter // for rate-limiting
9090
buf *bytes.Buffer
91-
handler slog.Handler
91+
handler slog.Handler
9292
}
9393

9494
// ensureLogger returns l if non-nil, otherwise a discard logger.

0 commit comments

Comments
 (0)