tons of cursor-shit cleaning, finished implementing cnxId in observer
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
|
||||
export function dispatchEvents(redisCnx, msg, chan, eventHandlers) {
|
||||
const eventType = msg.eventType
|
||||
const sender = msg.sender ?? null
|
||||
const cnxId = msg.cnxId ?? null
|
||||
if(!eventType || typeof(eventType) !== 'string') return(false)
|
||||
|
||||
let handled = false
|
||||
@@ -13,7 +15,7 @@ export function dispatchEvents(redisCnx, msg, chan, eventHandlers) {
|
||||
|
||||
for(const handle of handlers) {
|
||||
try {
|
||||
handle.call(redisCnx, msg, chan)
|
||||
handle.call(redisCnx, msg, chan, sender, cnxId)
|
||||
} catch(err) {
|
||||
console.error(
|
||||
`[${redisCnx.redisId}] Event ${eventType} on ${chan} failed:`,
|
||||
|
||||
Reference in New Issue
Block a user