From 957fd7211bd88fbbd934dc96f40360dee44909bc Mon Sep 17 00:00:00 2001 From: marco Date: Mon, 11 Mar 2024 16:05:28 +0100 Subject: [PATCH] interval messages --- pkg/csconfig/crowdsec_service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/csconfig/crowdsec_service.go b/pkg/csconfig/crowdsec_service.go index c54b850f622f..3acb53763e5c 100644 --- a/pkg/csconfig/crowdsec_service.go +++ b/pkg/csconfig/crowdsec_service.go @@ -151,13 +151,13 @@ func (c *Config) LoadCrowdsec() error { func (c *CrowdsecServiceCfg) setMetricsInterval() { switch { case c.MetricsInterval == nil: - c.MetricsInterval = ptr.Of(defaultMetricsInterval) log.Tracef("metrics_interval is not set, default to %s", defaultMetricsInterval) + c.MetricsInterval = ptr.Of(defaultMetricsInterval) case *c.MetricsInterval == time.Duration(0): log.Info("metrics_interval is set to 0, disabling metrics") case *c.MetricsInterval < minimumMetricsInterval: + log.Warnf("metrics_interval is too low (%s), setting it to %s", *c.MetricsInterval, minimumMetricsInterval) c.MetricsInterval = ptr.Of(minimumMetricsInterval) - log.Warnf("metrics_interval is too low, setting it to %s", minimumMetricsInterval) default: log.Tracef("metrics_interval set to %s", c.MetricsInterval) }