This commit is contained in:
luying
2022-04-02 17:43:12 +08:00
parent f50c32079c
commit 89744aeb13
11 changed files with 193 additions and 7 deletions
+6 -2
View File
@@ -545,7 +545,8 @@ export async function redisSubScribe() {
let refundChannel = getRedisSubChannel(REDIS_KEY.REFUND_CHANNEL, env);
let treatRoleChannel = getRedisSubChannel(REDIS_KEY.TREAT_ROLE_CHANNEL, env);
let treatGuildChannel = getRedisSubChannel(REDIS_KEY.TREAT_GUILD_CHANNEL, env);
await redisClientPub().subscribeAsync(payChannel, treatRoleChannel, treatGuildChannel, refundChannel);
let surveyChannel = getRedisSubChannel(REDIS_KEY.SURVEY_CHANNEL, env);
await redisClientPub().subscribeAsync(payChannel, treatRoleChannel, treatGuildChannel, refundChannel, surveyChannel);
redisClientPub().on('message', (channel, message) => {
console.log('**********redisSubScribe*******')
console.log('channel: ', channel, payChannel);
@@ -566,7 +567,10 @@ export async function redisSubScribe() {
let servers = pinus.app.getServersByType('order');
let server = getRandSingleEelm(servers);
pinus.app.rpc.order.orderRemote.refundOrderFromRedisPub.toServer(server.id, message);
} else if (channel == surveyChannel) {
let servers = pinus.app.getServersByType('role');
let server = getRandSingleEelm(servers);
pinus.app.rpc.role.roleRemote.sendSurveyMail.toServer(server.id, message);
}
});
}