From 7fdeb44372e8c93a61d326c388eab8864196bdae Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Wed, 18 Mar 2020 00:37:28 +0100 Subject: [PATCH] info: Initialize boot time early so uptime will always be correct (#9154) --- cmd/gateway-main.go | 5 +---- cmd/globals.go | 4 ++-- cmd/server-main.go | 3 --- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/cmd/gateway-main.go b/cmd/gateway-main.go index 117d57c5f..5a4d80eb2 100644 --- a/cmd/gateway-main.go +++ b/cmd/gateway-main.go @@ -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() } diff --git a/cmd/globals.go b/cmd/globals.go index 0e8015c34..842142bf2 100644 --- a/cmd/globals.go +++ b/cmd/globals.go @@ -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 diff --git a/cmd/server-main.go b/cmd/server-main.go index d8c86316f..e3deeb9d9 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -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() }