@cap-js-community/event-queue 2.0.0-beta.6 → 2.0.0-beta.7

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.0-beta.6",
3
+ "version": "2.0.0-beta.7",
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",
@@ -353,12 +353,14 @@ class EventQueueProcessorBase {
353
353
  statusMap[id] = statusOrUpdateData;
354
354
  return;
355
355
  }
356
+
356
357
  if ([EventProcessingStatus.Error, EventProcessingStatus.Exceeded].includes(statusMap[id].status)) {
357
358
  // NOTE: worst aggregation --> if already error|exceeded keep this state
358
359
  return;
359
360
  }
360
- if (statusMap[id].status >= 0) {
361
- statusMap[id] = { status: statusOrUpdateData };
361
+
362
+ if (statusMap[id].status >= statusOrUpdateData.status) {
363
+ statusMap[id] = statusOrUpdateData;
362
364
  }
363
365
  }
364
366