mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect/promql: fix panic on -search.disableCache
Reset the cache if it is disabled instead of stopping, since it is stopped on graceful shutdown.
This commit is contained in:
parent
ab740afd0d
commit
f4a38f7fb1
1 changed files with 3 additions and 6 deletions
|
@ -53,8 +53,7 @@ func InitRollupResultCache(cachePath string) {
|
||||||
c = workingsetcache.New(cacheSize, time.Hour)
|
c = workingsetcache.New(cacheSize, time.Hour)
|
||||||
}
|
}
|
||||||
if *disableCache {
|
if *disableCache {
|
||||||
c.Stop()
|
c.Reset()
|
||||||
c = nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stats := &fastcache.Stats{}
|
stats := &fastcache.Stats{}
|
||||||
|
@ -99,10 +98,8 @@ func InitRollupResultCache(cachePath string) {
|
||||||
// StopRollupResultCache closes the rollupResult cache.
|
// StopRollupResultCache closes the rollupResult cache.
|
||||||
func StopRollupResultCache() {
|
func StopRollupResultCache() {
|
||||||
if len(rollupResultCachePath) == 0 {
|
if len(rollupResultCachePath) == 0 {
|
||||||
if !*disableCache {
|
rollupResultCacheV.c.Stop()
|
||||||
rollupResultCacheV.c.Stop()
|
rollupResultCacheV.c = nil
|
||||||
rollupResultCacheV.c = nil
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
logger.Infof("saving rollupResult cache to %q...", rollupResultCachePath)
|
logger.Infof("saving rollupResult cache to %q...", rollupResultCachePath)
|
||||||
|
|
Loading…
Reference in a new issue