fix redis subscribe all keys
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
This commit is contained in:
parent
d09ad67823
commit
443a9d6b1b
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue