Merge pull request #67 from justinmueller05082000/bugfix/replace-timer-with-sleep

Replace timers with sleeps
This commit is contained in:
Noah Hilverling 2019-12-02 10:40:40 +01:00 committed by GitHub
commit afbfe16540
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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
}