small fix in multiRedis

This commit is contained in:
STEINNI
2025-10-08 18:24:21 +00:00
parent cbd16f09ab
commit 01bf35a238
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ export const methods = {
for(const rediscnx of this.allRediscnx){
if(!chan.startsWith(rediscnx.redisConfig.chansNamespace)) continue
else coudSubscribe = true
let localChan = rediscnx.redisConfig.basePrefix + localChan
let localChan = rediscnx.redisConfig.basePrefix + chan
if(!(localChan in rediscnx.subscriptions)) rediscnx.subscriptions[localChan] = [];
if(!rediscnx.subscriptions[localChan].includes(this.uuid)) {
rediscnx.subscriptions[localChan].push(this.uuid);
+2 -2
View File
@@ -71,7 +71,7 @@ export class RedisConnexion {
async redisSubscribe(chanName, callBack){
if(!chanName.startsWith(this.redisConfig.basePrefix)) chanName = this.redisConfig.basePrefix + chanName
if(!chanName.startsWith(this.redisConfig.basePrefix+this.chansNamespace)) {
if(!chanName.startsWith(this.redisConfig.basePrefix+this.redisConfig.chansNamespace)) {
console.warn(`[${this.redisConfig.redisId}] redisSubscribe : forbidden channel range on this redis !`)
return
}
@@ -81,7 +81,7 @@ export class RedisConnexion {
async redisPublish(chanName, msg){
if(typeof (msg) != 'string') msg = JSON.stringify(msg);
if(!chanName.startsWith(this.redisConfig.basePrefix)) chanName = this.redisConfig.basePrefix + chanName
if(!chanName.startsWith(this.redisConfig.basePrefix+this.chansNamespace)) {
if(!chanName.startsWith(this.redisConfig.basePrefix+this.redisConfig.chansNamespace)) {
console.warn(`[${this.redisConfig.redisId}] redisPublish : forbidden channel range on this redis !`)
return
}