* Introduce an "enable_groupcache" config to control initialization better
We initialize groupcache as a module, which happens after the config is parsed. A function named applyFIFOCacheConfig is called to enable fifocache if no cache is configured, and at the time of its calling the modules have not been initialized. This new "enable_groupcache" value is set if groupcache is configured in common, or this value is set manually. With this setting, we can prevent automatic fifocache settings.
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
* Add tests
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
* Simplifying condition
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
f.IntVar(&cfg.AsyncCacheWriteBackBufferSize,prefix+"max-async-cache-write-back-buffer-size",500,"The maximum number of enqueued asynchronous writeback cache allowed.")
f.IntVar(&cfg.AsyncCacheWriteBackBufferSize,prefix+"max-async-cache-write-back-buffer-size",500,"The maximum number of enqueued asynchronous writeback cache allowed.")
f.DurationVar(&cfg.DefaultValidity,prefix+"default-validity",time.Hour,description+"The default validity of entries for caches unless overridden.")
f.DurationVar(&cfg.DefaultValidity,prefix+"default-validity",time.Hour,description+"The default validity of entries for caches unless overridden.")
f.BoolVar(&cfg.EnableFifoCache,prefix+"cache.enable-fifocache",false,description+"Enable in-memory cache (auto-enabled for the chunks & query results cache if no other cache is configured).")
f.BoolVar(&cfg.EnableFifoCache,prefix+"cache.enable-fifocache",false,description+"Enable in-memory cache (auto-enabled for the chunks & query results cache if no other cache is configured).")