@cap-js-community/event-queue 1.0.2 → 1.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": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "An event queue that enables secure transactional processing of asynchronous 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": [
@@ -22,8 +22,10 @@ const checkAndInsertPeriodicEvents = async (context) => {
22
22
  },
23
23
  "AND",
24
24
  { ref: ["status"] },
25
- "=",
26
- { val: EventProcessingStatus.Open },
25
+ "IN",
26
+ {
27
+ list: [{ val: EventProcessingStatus.Open }, { val: EventProcessingStatus.InProgress }],
28
+ },
27
29
  ])
28
30
  .columns(["ID", "type", "subType", "startAfter"]);
29
31
  const currentPeriodEvents = await tx.run(baseCqn);
package/src/runner.js CHANGED
@@ -88,6 +88,7 @@ const _checkAndTriggerPeriodicEventUpdate = (tenantIds) => {
88
88
  return;
89
89
  }
90
90
  if (tenantIdHash && tenantIdHash !== hash) {
91
+ tenantIdHash = hash;
91
92
  cds.log(COMPONENT_NAME).info("tenant id hash changed, triggering updating periodic events!");
92
93
  _multiTenancyPeriodicEvents().catch((err) => {
93
94
  cds.log(COMPONENT_NAME).error("Error during triggering updating periodic events!", err);
@@ -300,7 +301,7 @@ const _checkPeriodicEventsSingleTenant = async (context = {}) => {
300
301
  return;
301
302
  }
302
303
  try {
303
- logger.info("executing updating periotic events", {
304
+ logger.info("executing updating periodic events", {
304
305
  tenantId: context.tenant,
305
306
  subdomain: context.http?.req.authInfo.getSubdomain(),
306
307
  });