events: don't enter a busy loop on error
Closes: https://github.com/emersion/hydroxide/issues/56
This commit is contained in:
parent
6d69d5ef72
commit
f0d0d64b4f
|
@ -28,6 +28,10 @@ func (r *Receiver) receiveEvents() {
|
|||
event, err := r.c.GetEvent(last)
|
||||
if err != nil {
|
||||
log.Println("cannot receive event:", err)
|
||||
select {
|
||||
case <-t.C:
|
||||
case <-r.poll:
|
||||
}
|
||||
continue
|
||||
}
|
||||
last = event.ID
|
||||
|
|
Loading…
Reference in New Issue