@cap-js-community/event-queue 1.3.2 → 1.3.3
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 +3 -3
- package/src/config.js +1 -1
- package/src/initialize.js +1 -1
- package/src/processEventQueue.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cap-js-community/event-queue",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
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
|
"files": [
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"yaml": "2.4.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@cap-js/hana": "^0.0.
|
|
50
|
+
"@cap-js/hana": "^0.0.6",
|
|
51
51
|
"@cap-js/sqlite": "^1.5.0",
|
|
52
|
-
"@sap/cds": "^7.
|
|
52
|
+
"@sap/cds": "^7.7.0",
|
|
53
53
|
"@sap/cds-dk": "^7.5.1",
|
|
54
54
|
"eslint": "^8.56.0",
|
|
55
55
|
"eslint-config-prettier": "^9.1.0",
|
package/src/config.js
CHANGED
package/src/initialize.js
CHANGED
|
@@ -30,7 +30,7 @@ const CONFIG_VARS = [
|
|
|
30
30
|
["registerAsEventProcessor", true],
|
|
31
31
|
["processEventsAfterPublish", true],
|
|
32
32
|
["isEventQueueActive", true],
|
|
33
|
-
["runInterval",
|
|
33
|
+
["runInterval", 25 * 60 * 1000],
|
|
34
34
|
["tableNameEventQueue", BASE_TABLES.EVENT],
|
|
35
35
|
["tableNameEventLock", BASE_TABLES.LOCK],
|
|
36
36
|
["disableRedis", false],
|
package/src/processEventQueue.js
CHANGED
|
@@ -11,7 +11,6 @@ const { limiter } = require("./shared/common");
|
|
|
11
11
|
const { executeInNewTransaction, TriggerRollback } = require("./shared/cdsHelper");
|
|
12
12
|
|
|
13
13
|
const COMPONENT_NAME = "/eventQueue/processEventQueue";
|
|
14
|
-
const MAX_EXECUTION_TIME = 5 * 60 * 1000;
|
|
15
14
|
|
|
16
15
|
const processEventQueue = async (context, eventType, eventSubType, startTime = new Date()) => {
|
|
17
16
|
let iterationCounter = 0;
|
|
@@ -115,7 +114,7 @@ const reevaluateShouldContinue = (eventTypeInstance, iterationCounter, startTime
|
|
|
115
114
|
if (eventTypeInstance.emptyChunkSelected) {
|
|
116
115
|
return false; // the last selected chunk was empty - no more data for processing
|
|
117
116
|
}
|
|
118
|
-
if (new Date(startTime.getTime() +
|
|
117
|
+
if (new Date(startTime.getTime() + config.runInterval) > new Date()) {
|
|
119
118
|
return true;
|
|
120
119
|
}
|
|
121
120
|
eventTypeInstance.logTimeExceeded(iterationCounter);
|