Add error handling for channel backend calls

This commit is contained in:
Peter Stuifzand 2018-12-08 15:37:04 +01:00
parent 81adf6bbca
commit e0fd9d26ac
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -641,7 +641,10 @@ func (b *memoryBackend) channelAddItemWithMatcher(conn redis.Conn, channel strin
if matchItem(item, re) {
log.Printf("Included %#v\n", item)
b.channelAddItem(conn, channelKey, item)
err := b.channelAddItem(conn, channelKey, item)
if err != nil {
continue
}
updatedChannels = append(updatedChannels, channelKey)
}
}
@ -649,7 +652,11 @@ func (b *memoryBackend) channelAddItemWithMatcher(conn redis.Conn, channel strin
// Update all channels that have added items, because of the include matching
for _, value := range updatedChannels {
b.updateChannelUnreadCount(conn, value)
err := b.updateChannelUnreadCount(conn, value)
if err != nil {
log.Printf("error while updating unread count for %s: %s", value, err)
continue
}
}
// Check for the exclude regex