mirror of
https://github.com/minio/minio.git
synced 2025-02-13 06:38:09 -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 {
|
if err != nil {
|
||||||
logger.FatalIf(err, "Unable to get free port for Console UI on the host")
|
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())
|
consoleAddr = net.JoinHostPort("", p.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user