From b6659b40eb45e7662d4e80260fe1d5c2cd08f597 Mon Sep 17 00:00:00 2001 From: haller33 Date: Fri, 30 Aug 2024 11:09:14 -0300 Subject: [PATCH] fix(agent): prevent zero value when KEEPALIVE_INTERVAL is empty --- pkg/agent/agent.go | 2 +- pkg/agent/connector/docker.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/agent/agent.go b/pkg/agent/agent.go index 99498911132..27eac02528b 100644 --- a/pkg/agent/agent.go +++ b/pkg/agent/agent.go @@ -100,7 +100,7 @@ type Config struct { // Determine the interval to send the keep alive message to the server. This // has a direct impact of the bandwidth used by the device when in idle // state. Default is 30 seconds. - KeepAliveInterval uint `env:"KEEPALIVE_INTERVAL,default=30"` + KeepAliveInterval uint `env:"KEEPALIVE_INTERVAL,default=30,overwrite"` // Set the device preferred hostname. This provides a hint to the server to // use this as hostname if it is available. diff --git a/pkg/agent/connector/docker.go b/pkg/agent/connector/docker.go index 7f3f03225c7..42d7337f883 100644 --- a/pkg/agent/connector/docker.go +++ b/pkg/agent/connector/docker.go @@ -52,7 +52,7 @@ type Config struct { // Determine the interval to send the keep alive message to the server. This // has a direct impact of the bandwidth used by the device when in idle // state. Default is 30 seconds. - KeepAliveInterval int `env:"KEEPALIVE_INTERVAL,default=30"` + KeepAliveInterval int `env:"KEEPALIVE_INTERVAL,default=30,overwrite"` } func LoadConfigFromEnv() (*Config, map[string]interface{}, error) {