@cap-js-community/event-queue 1.10.7 → 1.10.8

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.7",
3
+ "version": "1.10.8",
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",
@@ -38,34 +38,33 @@ const getOpenQueueEntries = async (tx, filterAppSpecificEvents = true) => {
38
38
  for (const { type, subType } of entries) {
39
39
  if (eventConfig.isCapOutboxEvent(type)) {
40
40
  const [srvName, actionName] = subType.split(".");
41
- cds.connect
42
- .to(srvName)
43
- .then((service) => {
44
- if (!filterAppSpecificEvents) {
45
- return; // will be done in finally
46
- }
41
+ try {
42
+ const service = await cds.connect.to(srvName);
43
+ if (!filterAppSpecificEvents) {
44
+ return; // will be done in finally
45
+ }
47
46
 
48
- if (!service) {
49
- return;
50
- }
51
- cds.outboxed(service);
52
- if (actionName) {
53
- config.addCAPOutboxEventSpecificAction(srvName, actionName);
54
- }
55
- if (filterAppSpecificEvents) {
56
- if (eventConfig.shouldBeProcessedInThisApplication(type, subType)) {
57
- result.push({ type, subType });
58
- }
59
- } else {
60
- result.push({ type, subType });
61
- }
62
- })
63
- .catch(() => {})
64
- .finally(() => {
65
- if (!filterAppSpecificEvents) {
47
+ if (!service) {
48
+ return;
49
+ }
50
+ cds.outboxed(service);
51
+ if (actionName) {
52
+ config.addCAPOutboxEventSpecificAction(srvName, actionName);
53
+ }
54
+ if (filterAppSpecificEvents) {
55
+ if (eventConfig.shouldBeProcessedInThisApplication(type, subType)) {
66
56
  result.push({ type, subType });
67
57
  }
68
- });
58
+ } else {
59
+ result.push({ type, subType });
60
+ }
61
+ } catch {
62
+ /* ignore catch */
63
+ } finally {
64
+ if (!filterAppSpecificEvents) {
65
+ result.push({ type, subType });
66
+ }
67
+ }
69
68
  } else {
70
69
  if (filterAppSpecificEvents) {
71
70
  if (