Fix: Start cache manager only when NumCacheIntervals > 0

This commit is contained in:
Holger Obermaier 2022-02-15 11:27:42 +01:00
parent 01faa3b531
commit 69b31e87e7

View File

@ -100,7 +100,7 @@ func (r *metricRouter) Init(ticker mct.MultiChanTicker, wg *sync.WaitGroup, rout
cclog.ComponentError("MetricRouter", err.Error())
return err
}
if r.config.NumCacheIntervals >= 0 {
if r.config.NumCacheIntervals > 0 {
r.cache, err = NewCache(r.cache_input, r.ticker, &r.cachewg, r.config.NumCacheIntervals)
if err != nil {
cclog.ComponentError("MetricRouter", "MetricCache initialization failed:", err.Error())