From e6dc686b636368f12da5a07aadbd9624ce8b50a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Justin=20M=C3=BCller?= Date: Mon, 2 Dec 2019 09:30:46 +0100 Subject: [PATCH] Replace timers with sleeps refs #51 --- configobject/history/history.go | 2 +- configobject/statesync/statesync.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configobject/history/history.go b/configobject/history/history.go index 85bfcb9c..d233af26 100644 --- a/configobject/history/history.go +++ b/configobject/history/history.go @@ -433,7 +433,7 @@ func flappingHistoryWorker(super *supervisor.Supervisor) { func historyWorker(super *supervisor.Supervisor, historyType string, preparedStatements []string, dataFunctions []func(map[string]interface{}) []interface{}, observer prometheus.Observer) { if super.EnvId == nil { log.Debug(historyType + "History: Waiting for EnvId to be set") - <-time.NewTimer(time.Second).C + time.Sleep(time.Second) return } diff --git a/configobject/statesync/statesync.go b/configobject/statesync/statesync.go index 862f1541..c6e75211 100644 --- a/configobject/statesync/statesync.go +++ b/configobject/statesync/statesync.go @@ -65,7 +65,7 @@ func logSyncCounters() { func syncStates(super *supervisor.Supervisor, objectType string) { if super.EnvId == nil { log.Debug("StateSync: Waiting for EnvId to be set") - <-time.NewTimer(time.Second).C + time.Sleep(time.Second) return }