Remove channel from Redis when channels is deleted

This commit is contained in:
Peter Stuifzand 2018-06-30 15:52:20 +02:00
parent 9e4c93a389
commit 7d7d55099e

View File

@ -189,6 +189,12 @@ func (b *memoryBackend) ChannelsUpdate(uid, name string) microsub.Channel {
func (b *memoryBackend) ChannelsDelete(uid string) { func (b *memoryBackend) ChannelsDelete(uid string) {
defer b.save() defer b.save()
conn := pool.Get()
defer conn.Close()
conn.Do("SREM", "channels", uid)
conn.Do("DEL", "channel_sortorder_"+uid)
delete(b.Channels, uid) delete(b.Channels, uid)
delete(b.Feeds, uid) delete(b.Feeds, uid)
} }