fix redis subscribe all keys

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
This commit is contained in:
Pravin Pushkar 2022-10-06 17:05:27 +05:30
parent d09ad67823
commit 443a9d6b1b
1 changed files with 6 additions and 1 deletions

View File

@ -299,7 +299,12 @@ func (r *ConfigurationStore) Unsubscribe(ctx context.Context, req *configuration
func (r *ConfigurationStore) doSubscribe(ctx context.Context, req *configuration.SubscribeRequest, handler configuration.UpdateHandler, redisChannel4revision string, id string, stop chan struct{}) {
// enable notify-keyspace-events by redis Set command
r.client.ConfigSet(ctx, "notify-keyspace-events", "KA")
p := r.client.Subscribe(ctx, redisChannel4revision)
var p *redis.PubSub
if redisChannel4revision == keySpaceAny {
p = r.client.PSubscribe(ctx, redisChannel4revision)
} else {
p = r.client.Subscribe(ctx, redisChannel4revision)
}
for {
select {
case <-stop: