mirror of
https://github.com/minio/minio.git
synced 2025-11-21 18:26:04 -05:00
allow more socket listeners per instance for multi-core setups (#13385)
This commit is contained in:
@@ -260,8 +260,16 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
|
||||
getCert = globalTLSCerts.GetCertificate
|
||||
}
|
||||
|
||||
httpServer := xhttp.NewServer([]string{globalMinioAddr},
|
||||
criticalErrorHandler{corsHandler(router)}, getCert)
|
||||
listeners := ctx.Int("listeners")
|
||||
if listeners == 0 {
|
||||
listeners = 1
|
||||
}
|
||||
addrs := make([]string, 0, listeners)
|
||||
for i := 0; i < listeners; i++ {
|
||||
addrs = append(addrs, globalMinioAddr)
|
||||
}
|
||||
|
||||
httpServer := xhttp.NewServer(addrs, criticalErrorHandler{corsHandler(router)}, getCert)
|
||||
httpServer.BaseContext = func(listener net.Listener) context.Context {
|
||||
return GlobalContext
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user