@cap-js-community/event-queue 1.10.3 → 1.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/EventQueueProcessorBase.js +6 -1
- package/src/config.js +3 -4
- package/src/initialize.js +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cap-js-community/event-queue",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.4",
|
|
4
4
|
"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
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -174,7 +174,12 @@ class EventQueueProcessorBase {
|
|
|
174
174
|
eventSubType: this.#eventSubType,
|
|
175
175
|
iterationCounter,
|
|
176
176
|
});
|
|
177
|
-
this.#eventSchedulerInstance.scheduleEvent(
|
|
177
|
+
this.#eventSchedulerInstance.scheduleEvent(
|
|
178
|
+
this.__context.tenant,
|
|
179
|
+
this.#eventType,
|
|
180
|
+
this.#eventSubType,
|
|
181
|
+
new Date(Date.now() + 5 * 1000) // add some offset to make sure all locks are released
|
|
182
|
+
);
|
|
178
183
|
}
|
|
179
184
|
|
|
180
185
|
logStartMessage() {
|
package/src/config.js
CHANGED
|
@@ -638,18 +638,17 @@ class Config {
|
|
|
638
638
|
let cron;
|
|
639
639
|
|
|
640
640
|
// NOTE: logic is as follows:
|
|
641
|
-
// - if event.utc is true --> always use UTC
|
|
641
|
+
// - if event.utc is true --> always use UTC (default is false)
|
|
642
642
|
// - if event.useCronTimezone is false OR event.cronTimezone is not defined --> use UTC as well
|
|
643
643
|
// - if event.utc is not true AND event.cronTimezone is set AND event.useCronTimezone is NOT set to false use event.cronTimezone
|
|
644
644
|
event.utc = event.utc ?? UTC_DEFAULT;
|
|
645
|
-
|
|
646
|
-
if (!event.cronTimezone) {
|
|
645
|
+
if (!this.cronTimezone) {
|
|
647
646
|
event.useCronTimezone = false;
|
|
648
647
|
} else {
|
|
649
648
|
event.useCronTimezone = event.useCronTimezone ?? USE_CRON_TZ_DEFAULT;
|
|
650
649
|
}
|
|
651
650
|
|
|
652
|
-
event.tz = event.utc || !event.useCronTimezone ? "UTC" :
|
|
651
|
+
event.tz = event.utc || !event.useCronTimezone ? "UTC" : this.cronTimezone;
|
|
653
652
|
|
|
654
653
|
try {
|
|
655
654
|
cron = CronExpressionParser.parse(event.cron);
|
package/src/initialize.js
CHANGED
|
@@ -182,6 +182,14 @@ const monkeyPatchCAPOutbox = () => {
|
|
|
182
182
|
get: () => eventQueueAsOutbox.unboxed,
|
|
183
183
|
configurable: true,
|
|
184
184
|
});
|
|
185
|
+
Object.defineProperty(cds, "queued", {
|
|
186
|
+
get: () => eventQueueAsOutbox.outboxed,
|
|
187
|
+
configurable: true,
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(cds, "unqueued", {
|
|
190
|
+
get: () => eventQueueAsOutbox.unboxed,
|
|
191
|
+
configurable: true,
|
|
192
|
+
});
|
|
185
193
|
}
|
|
186
194
|
};
|
|
187
195
|
|