info: Initialize boot time early so uptime will always be correct (#9154)

This commit is contained in:
Anis Elleuch 2020-03-18 00:37:28 +01:00 committed by GitHub
parent 59dced8237
commit 7fdeb44372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/*
* MinIO Cloud Storage, (C) 2017, 2018 MinIO, Inc.
* MinIO Cloud Storage, (C) 2017-2020 MinIO, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -309,8 +309,5 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
printGatewayStartupMessage(getAPIEndpoints(), gatewayName)
}
// Set uptime time after object layer has initialized.
globalBootTime = UTCNow()
handleSignals()
}

View File

@ -188,8 +188,8 @@ var (
// Global HTTP request statisitics
globalHTTPStats = newHTTPStats()
// Time when object layer was initialized on start up.
globalBootTime time.Time
// Time when the server is started
globalBootTime = UTCNow()
globalActiveCred auth.Credentials

View File

@ -441,9 +441,6 @@ func serverMain(ctx *cli.Context) {
logger.StartupMessage(color.RedBold(msg))
}
// Set uptime time after object layer has initialized.
globalBootTime = UTCNow()
handleSignals()
}