Replace timers with sleeps

refs #51
This commit is contained in:
Justin Müller 2019-12-02 09:30:46 +01:00
parent 28743ca4d3
commit e6dc686b63
2 changed files with 2 additions and 2 deletions

View file

@ -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
}

View file

@ -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
}