@cap-js-community/event-queue 2.0.2 → 2.0.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": "2.0.2",
3
+ "version": "2.0.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
  "types": "src/index.d.ts",
@@ -24,10 +24,10 @@
24
24
  "scripts": {
25
25
  "start": "PORT=4005 cds-serve",
26
26
  "watch": "PORT=4005 cds watch",
27
- "test:unit": "jest --testPathIgnorePatterns=\"/test-integration/\"",
28
- "test:integration": "jest --testPathIgnorePatterns=\"/test/\" --runInBand --forceExit",
29
- "voter:test:integration": "jest --testPathIgnorePatterns=\"/test/\" --forceExit",
30
- "test": "npm run test:unit && npm run test:integration",
27
+ "test:unit": "jest --selectProjects unit",
28
+ "test:integration": "jest --selectProjects integration --runInBand",
29
+ "voter:test:integration": "jest --selectProjects integration",
30
+ "test": "jest --runInBand",
31
31
  "test:all:coverage": "jest --runInBand --forceExit --collect-coverage",
32
32
  "test:prepare": "npm run build:ci --prefix=./test-integration/_env",
33
33
  "test:deploySchema": "node test-integration/_env/srv/hana/deploy.js",
@@ -79,6 +79,9 @@
79
79
  },
80
80
  "cds": {
81
81
  "eventQueue": {
82
+ "[development]": {
83
+ "cleanupLocksAndEventsForDev": true
84
+ },
82
85
  "[production]": {
83
86
  "disableRedis": false
84
87
  },
@@ -703,7 +703,7 @@ class EventQueueProcessorBase {
703
703
  )
704
704
  .orderBy("createdAt", "ID");
705
705
 
706
- if (this.#eventConfig.selectedDelayedEventIds) {
706
+ if (this.#eventConfig.selectedDelayedEventIds.length) {
707
707
  cqn.where("ID NOT IN", this.#eventConfig.selectedDelayedEventIds);
708
708
  }
709
709
 
@@ -37,6 +37,10 @@ class EventQueueDeleteEvents extends EventQueueBaseClass {
37
37
  { ref: ["lastAttemptTimestamp"] },
38
38
  "<=",
39
39
  { val: new Date(processContext.timestamp.getTime() - deleteAfter * DAY_IN_MS).toISOString() },
40
+ "AND",
41
+ { ref: ["namespace"] },
42
+ "IN",
43
+ { list: config.processingNamespaces.map((value) => ({ val: value })) },
40
44
  ])
41
45
  );
42
46
  this.logger.info("deleted eligible events", {
@@ -1,7 +1,6 @@
1
1
  using sap.eventqueue as db from '../../db';
2
2
 
3
3
  @path: 'event-queue/admin'
4
- @impl: './admin-service.js'
5
4
  @requires: 'internal-user'
6
5
  service EventQueueAdminService {
7
6