mirror of
https://github.com/minio/minio.git
synced 2025-02-03 01:46:00 -05:00
fix: GetFreePort() will get the same port (#18604)
This commit is contained in:
parent
4bc5ed6c76
commit
5cc2c62c66
@ -388,6 +388,11 @@ func handleCommonCmdArgs(ctx *cli.Context) {
|
||||
if err != nil {
|
||||
logger.FatalIf(err, "Unable to get free port for Console UI on the host")
|
||||
}
|
||||
// hold the port
|
||||
l, err := net.Listen("TCP", fmt.Sprintf(":%s", p.String()))
|
||||
if err == nil {
|
||||
defer l.Close()
|
||||
}
|
||||
consoleAddr = net.JoinHostPort("", p.String())
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user