Return error when no logs/headers available

- Replaces bool and moots question of error/bool ordering
- Also make event watcher execution synchronous
This commit is contained in:
Rob Mulholand
2019-09-18 20:55:15 -05:00
parent 2b798e00e0
commit 4fa19be90a
9 changed files with 137 additions and 164 deletions
+3 -7
View File
@@ -160,13 +160,9 @@ func watchEthEvents(w *watcher.EventWatcher, wg *syn.WaitGroup) {
} else {
recheck = constants.HeaderUnchecked
}
errs := make(chan error)
go w.Execute(recheck, errs)
for {
select {
case err := <-errs:
LogWithCommand.Fatalf("error executing event watcher: %s", err.Error())
}
err := w.Execute(recheck)
if err != nil {
LogWithCommand.Fatalf("error executing event watcher: %s", err.Error())
}
}