Don't spew errors if the event channel is closed
@@ -19,7 +19,8 @@ func (k *Keepalived) processKeepalives() {
for {
select {
- case msg := <-k.keepaliveChan:
+ case msg, ok := <-k.keepaliveChan:
+ if ok {
err := json.Unmarshal(msg, event)
if err != nil {
logger.WithError(err).Error("error unmarshaling keepliave event")
@@ -31,6 +32,7 @@ func (k *Keepalived) processKeepalives() {
logger.WithError(err).Error("error updating keepalive in store")
continue
}
+ }
case <-k.stopping:
return
}
