Always flush cache after timer run

This commit is contained in:
Łukasz Mierzwa
2017-04-25 13:49:24 -07:00
parent b261e853a5
commit f7dc5173d6

View File

@@ -21,6 +21,9 @@ import (
// PullFromAlertmanager will try to fetch latest alerts and silences
// from Alertmanager API, it's called by Ticker timer
func PullFromAlertmanager() {
// always flush cache once we're done
defer apiCache.Flush()
log.Info("Pulling latest alerts and silences from Alertmanager")
v := alertmanager.GetVersion()
@@ -138,7 +141,6 @@ func PullFromAlertmanager() {
store.Store.Update(alertStore, colorStore, acStore)
log.Info("Pull completed")
apiCache.Flush()
runtime.GC()
}