mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
all: fix golangci-lint(revive) warnings after 0c0ed61ce7
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6001
This commit is contained in:
@@ -90,7 +90,7 @@ type RequestHandler func(w http.ResponseWriter, r *http.Request) bool
|
||||
// See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
|
||||
func Serve(addrs []string, useProxyProtocol *flagutil.ArrayBool, rh RequestHandler) {
|
||||
if rh == nil {
|
||||
rh = func(w http.ResponseWriter, r *http.Request) bool {
|
||||
rh = func(_ http.ResponseWriter, _ *http.Request) bool {
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -152,7 +152,7 @@ func serveWithListener(addr string, ln net.Listener, rh RequestHandler) {
|
||||
ErrorLog: logger.StdErrorLogger(),
|
||||
}
|
||||
if *connTimeout > 0 {
|
||||
s.s.ConnContext = func(ctx context.Context, c net.Conn) context.Context {
|
||||
s.s.ConnContext = func(ctx context.Context, _ net.Conn) context.Context {
|
||||
timeoutSec := connTimeout.Seconds()
|
||||
// Add a jitter for connection timeout in order to prevent Thundering herd problem
|
||||
// when all the connections are established at the same time.
|
||||
|
||||
Reference in New Issue
Block a user