[#493] cmd/node: Fix linter errors in config

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-06-02 15:44:41 +03:00 committed by Alex Vanin
parent e9e986ac71
commit a2547da5ae
9 changed files with 19 additions and 12 deletions

View file

@ -9,17 +9,20 @@ import (
const (
subsection = "metrics"
// ShutdownTimeoutDefault is a default value for metrics HTTP service timeout.
ShutdownTimeoutDefault = 30 * time.Second
AddressDefault = ""
// AddressDefault is a default value for metrics HTTP service endpoint.
AddressDefault = ""
)
// ShutdownTimeout returns value of "shutdown_timeout" config parameter
// from "metrics" section.
//
// Returns ShutdownTimeoutDefault if value is not set.
// Returns ShutdownTimeoutDefault if value is not positive duration.
func ShutdownTimeout(c *config.Config) time.Duration {
v := config.DurationSafe(c.Sub(subsection), "shutdown_timeout")
if v != 0 {
if v > 0 {
return v
}