fix: missing cleanup of tmp folders in NAS gateway setup (#13124)

console service should be shutdown last once all shutdown
sequences are complete, this is to ensure that we do not
prematurely kill the server before it cleans up the

`.minio.sys/tmp/uuid` folder.

NOTE: this only applies to NAS gateway setup.
This commit is contained in:
Harshavardhana
2021-08-31 18:52:48 -07:00
committed by GitHub
parent 72a288f73f
commit f89d0f68d0
5 changed files with 17 additions and 14 deletions

View File

@@ -345,18 +345,14 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
}
if globalBrowserEnabled {
consoleSrv, err := initConsoleServer()
globalConsoleSrv, err = initConsoleServer()
if err != nil {
logger.FatalIf(err, "Unable to initialize console service")
}
go func() {
<-globalOSSignalCh
consoleSrv.Shutdown()
logger.FatalIf(globalConsoleSrv.Serve(), "Unable to initialize console server")
}()
consoleSrv.Serve()
} else {
<-globalOSSignalCh
}
<-globalOSSignalCh
}