@cap-js-community/event-queue 1.10.9 → 1.10.11

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.10.9",
3
+ "version": "1.10.11",
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",
@@ -54,17 +54,17 @@
54
54
  "yaml": "^2.7.1"
55
55
  },
56
56
  "devDependencies": {
57
- "@cap-js/cds-test": "^0.3.0",
57
+ "@cap-js/cds-test": "^0.4.0",
58
58
  "@cap-js/hana": "^2.1.0",
59
59
  "@cap-js/sqlite": "^2.0.1",
60
- "@sap/cds": "^9.0.3",
61
- "@sap/cds-dk": "^9.0.4",
60
+ "@sap/cds": "^9.1.0",
61
+ "@sap/cds-dk": "^9.1.0",
62
62
  "eslint": "^8.57.0",
63
63
  "eslint-config-prettier": "^9.1.0",
64
64
  "eslint-plugin-jest": "^28.6.0",
65
65
  "eslint-plugin-node": "^11.1.0",
66
66
  "express": "^4.21.2",
67
- "hdb": "^0.19.10",
67
+ "hdb": "^2.25.1",
68
68
  "jest": "^29.7.0",
69
69
  "prettier": "^2.8.8",
70
70
  "sqlite3": "^5.1.7",
package/src/config.js CHANGED
@@ -196,9 +196,7 @@ class Config {
196
196
  result = config.value.test(this.#env.applicationName);
197
197
  } else {
198
198
  const shouldBeProcessedBasedOnAppName = appNameConfig[this.#env.applicationName];
199
- if (!shouldBeProcessedBasedOnAppName) {
200
- result = config.value === this.#env.applicationName;
201
- }
199
+ result = !!shouldBeProcessedBasedOnAppName;
202
200
  }
203
201
  if (result) {
204
202
  break;
@@ -484,10 +482,11 @@ class Config {
484
482
  delete base.interval;
485
483
  }
486
484
 
487
- result[fnName] = Object.assign(
485
+ const subType = `${name}.${fnName}`;
486
+ result[subType] = Object.assign(
488
487
  {
489
488
  type: CAP_EVENT_TYPE,
490
- subType: `${name}.${fnName}`,
489
+ subType,
491
490
  impl: "./outbox/EventQueueGenericOutboxHandler",
492
491
  internalEvent: true,
493
492
  },
@@ -15,6 +15,9 @@ const COMPONENT_NAME = "/eventQueue/periodicEvents";
15
15
 
16
16
  const checkAndInsertPeriodicEvents = async (context) => {
17
17
  const now = new Date();
18
+ cds.log(COMPONENT_NAME).info("updating periodic events", {
19
+ tenant: context.tenant,
20
+ });
18
21
  const tx = cds.tx(context);
19
22
  const baseCqn = SELECT.from(eventConfig.tableNameEventQueue)
20
23
  .where([
@@ -509,6 +509,7 @@ const _checkPeriodicEventsSingleTenantOneTime = async () => {
509
509
  tenantScoped: false,
510
510
  });
511
511
  if (!couldAcquireLock) {
512
+ logger.info("skipping updating periodic events - lock not acquired");
512
513
  return;
513
514
  }
514
515
  return await cds.tx({}, async (tx) => await periodicEvents.checkAndInsertPeriodicEvents(tx.context));