@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cap-js-community/event-queue",
3
- "version": "1.3.2",
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.5",
50
+ "@cap-js/hana": "^0.0.6",
51
51
  "@cap-js/sqlite": "^1.5.0",
52
- "@sap/cds": "^7.5.3",
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
@@ -28,7 +28,7 @@ const BASE_PERIODIC_EVENTS = [
28
28
  subType: "DELETE_EVENTS",
29
29
  priority: Priorities.Low,
30
30
  impl: "./housekeeping/EventQueueDeleteEvents",
31
- load: 1,
31
+ load: 20,
32
32
  interval: 86400, // 1 day,
33
33
  internalEvent: true,
34
34
  },
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", 5 * 60 * 1000],
33
+ ["runInterval", 25 * 60 * 1000],
34
34
  ["tableNameEventQueue", BASE_TABLES.EVENT],
35
35
  ["tableNameEventLock", BASE_TABLES.LOCK],
36
36
  ["disableRedis", false],
@@ -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() + MAX_EXECUTION_TIME) > new Date()) {
117
+ if (new Date(startTime.getTime() + config.runInterval) > new Date()) {
119
118
  return true;
120
119
  }
121
120
  eventTypeInstance.logTimeExceeded(iterationCounter);