tons of cursor-shit cleaning, finished implementing cnxId in observer

This commit is contained in:
STEINNI
2026-06-27 17:24:41 +00:00
parent 4c9e989bda
commit a1dba5060a
28 changed files with 213 additions and 224 deletions
+5 -2
View File
@@ -27,14 +27,17 @@ export function assembleHandlers(modules) {
})
}
export function createDispatchMessage({ eventHandlers, actionRules }) {
export function createDispatchMessage({ eventHandlers, eventRules, actionRules }) {
return(async function dispatchMessage(redisCnx, msg, chan) {
if(msg.action && msg.eventType) {
console.warn(`[${redisCnx.redisId}] Message has both action and eventType on ${chan}`)
return(false)
}
if(msg.action) return(dispatchActions(redisCnx, msg, chan, actionRules(redisCnx)))
if(msg.eventType) return(dispatchEvents(redisCnx, msg, chan, eventHandlers))
if(msg.eventType) {
const handlers = eventRules ? eventRules(redisCnx) : eventHandlers
return(dispatchEvents(redisCnx, msg, chan, handlers))
}
return(false)
})
}