@cap-js-community/event-queue
Advanced tools
Comparing version 1.4.6 to 1.4.7
{ | ||
"name": "@cap-js-community/event-queue", | ||
"version": "1.4.6", | ||
"version": "1.4.7", | ||
"description": "An event queue that enables secure transactional processing of asynchronous and periodic events, featuring instant event processing with Redis Pub/Sub and load distribution across all application instances.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -5,3 +5,3 @@ "use strict"; | ||
const { broadcastEvent } = require("./redis/redisPub"); | ||
const redisPub = require("./redis/redisPub"); | ||
const config = require("./config"); | ||
@@ -29,3 +29,3 @@ | ||
const eventQueuePublishEvents = req.tx._.eventQueuePublishEvents; | ||
const data = Array.isArray(req.data) ? req.data : [req.data]; | ||
const data = Array.isArray(req.query.INSERT.entries) ? req.query.INSERT.entries : [req.query.INSERT.entries]; | ||
const eventCombinations = Object.keys( | ||
@@ -50,3 +50,3 @@ data.reduce((result, event) => { | ||
broadcastEvent(req.tenant, events).catch((err) => { | ||
redisPub.broadcastEvent(req.tenant, events).catch((err) => { | ||
cds.log(COMPONENT_NAME).error("db handler failure during broadcasting event", err, { | ||
@@ -53,0 +53,0 @@ tenant: req.tenant, |
@@ -30,5 +30,3 @@ "use strict"; | ||
}); | ||
this.#eventsByTenants[tenantId] ??= {}; | ||
const timeoutId = setTimeout(() => { | ||
delete this.#eventsByTenants[tenantId][timeoutId]; | ||
setTimeout(() => { | ||
delete this.#scheduledEvents[key]; | ||
@@ -44,8 +42,5 @@ redisPub.broadcastEvent(tenantId, { type, subType }).catch((err) => { | ||
}, relative).unref(); | ||
this.#eventsByTenants[tenantId][timeoutId] = true; | ||
} | ||
clearForTenant(tenantId) { | ||
Object.values(this.#eventsByTenants[tenantId]).forEach((timeoutId) => clearTimeout(timeoutId)); | ||
} | ||
clearForTenant() {} | ||
@@ -52,0 +47,0 @@ calculateOffset(type, subType, startAfter) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
174221
4329