tons of cursor-shit cleaning, finished implementing cnxId in observer
This commit is contained in:
@@ -3,12 +3,9 @@ export function busReplyRoute(daemonBlock, meshName) {
|
||||
if(!daemonBlock?.senderId) return(null)
|
||||
|
||||
const onArena = meshName === 'arena'
|
||||
const systemReply = daemonBlock.maestroActionsReply
|
||||
?? daemonBlock.gpsActionsReply
|
||||
?? daemonBlock.observerActionsReply
|
||||
const actionsReply = onArena
|
||||
? (daemonBlock.bus?.arena?.actionsReply ?? systemReply)
|
||||
: systemReply
|
||||
? (daemonBlock.bus?.arena?.actionsReply ?? daemonBlock.ActionsReply)
|
||||
: daemonBlock.ActionsReply
|
||||
|
||||
if(!actionsReply) return(null)
|
||||
|
||||
@@ -25,12 +22,13 @@ export function publishActionReply(redisCnx, options) {
|
||||
sender,
|
||||
reply,
|
||||
replyChannel,
|
||||
senderId,
|
||||
} = options
|
||||
reply.action = action
|
||||
reply.sender = senderId
|
||||
reply.sender = redisCnx.senderId
|
||||
reply.cnxId = redisCnx.cnxId
|
||||
if(reqid) reply.reqid = reqid
|
||||
const chan = replyChannel.replace(/\[UID\]/g, sender)
|
||||
.replace(/\[CUID\]/g, redisCnx.cnxId)
|
||||
redisCnx.redisPublish(chan, reply)
|
||||
}
|
||||
|
||||
@@ -43,13 +41,11 @@ export function replyToAction(redisCnx, options) {
|
||||
payload,
|
||||
err,
|
||||
replyChannel,
|
||||
senderId,
|
||||
} = options
|
||||
|
||||
const routeReplyChannel = replyChannel ?? redisCnx.actionsReply
|
||||
const routeSenderId = senderId ?? redisCnx.senderId
|
||||
|
||||
if(!routeReplyChannel || !routeSenderId) {
|
||||
if(!routeReplyChannel) {
|
||||
console.error(`[${redisCnx.redisId}] Cannot resolve action reply route`)
|
||||
return
|
||||
}
|
||||
@@ -63,7 +59,6 @@ export function replyToAction(redisCnx, options) {
|
||||
reqid,
|
||||
sender,
|
||||
replyChannel: routeReplyChannel,
|
||||
senderId: routeSenderId,
|
||||
reply,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user