1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

fix #1854 - fix __redis__:invalidate messages handler (#1856)

This commit is contained in:
Leibale Eidelman
2022-01-24 12:03:40 -05:00
committed by GitHub
parent cf120c3984
commit 551d2041dc

View File

@@ -82,10 +82,12 @@ export default class RedisCommandsQueue {
if (!listeners.strings.size) return;
// https://github.com/redis/redis/pull/7469
// https://github.com/redis/redis/issues/7463
const messageString = (Array.isArray(message) ? message.map(m => m.toString()) as any : message.toString()),
channelString = pattern ? channel.toString() : keyString;
const channelString = pattern ? channel.toString() : keyString,
messageString = channelString === '__redis__:invalidate' ?
// https://github.com/redis/redis/pull/7469
// https://github.com/redis/redis/issues/7463
(message === null ? null : (message as any as Array<Buffer>).map(x => x.toString())) as any :
message.toString();
for (const listener of listeners.strings) {
listener(messageString, channelString);
}