Merge pull request #76 from cloudflare/cache-flush

Always flush cache after timer run
This commit is contained in:
Łukasz Mierzwa
2017-04-25 14:59:06 -07:00
committed by GitHub

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()
}