Skip to content

Commit 6e02d7c

Browse files
committed
handle invalidate messages from topic __redis__:invalidate
1 parent cb3aa19 commit 6e02d7c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pubsub.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,18 @@ func (c *PubSub) newMessage(reply interface{}) (interface{}, error) {
409409
return &Pong{
410410
Payload: reply[1].(string),
411411
}, nil
412+
case "invalidate":
413+
payload := reply[1].([]interface{})
414+
ss := make([]string, len(payload))
415+
for i, s := range payload {
416+
ss[i] = s.(string)
417+
}
418+
return &Message{
419+
Channel: "__redis__:invalidate",
420+
PayloadSlice: ss,
421+
}, nil
412422
default:
413-
return nil, fmt.Errorf("redis: unsupported pubsub message: %q", kind)
423+
return nil, fmt.Errorf("redis: unsupported pubsub message aqui: %q", kind)
414424
}
415425
default:
416426
return nil, fmt.Errorf("redis: unsupported pubsub message: %#v", reply)

0 commit comments

Comments
 (0)