From 7d7d55099e81338002a43131be4aa04e6d1a7a95 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sat, 30 Jun 2018 15:52:20 +0200 Subject: [PATCH] Remove channel from Redis when channels is deleted --- cmd/eksterd/memory.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/eksterd/memory.go b/cmd/eksterd/memory.go index ba29b08..231d632 100644 --- a/cmd/eksterd/memory.go +++ b/cmd/eksterd/memory.go @@ -189,6 +189,12 @@ func (b *memoryBackend) ChannelsUpdate(uid, name string) microsub.Channel { func (b *memoryBackend) ChannelsDelete(uid string) { 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.Feeds, uid) }