@cap-js-community/event-queue
Advanced tools
Comparing version 1.2.3 to 1.2.4
{ | ||
"name": "@cap-js-community/event-queue", | ||
"version": "1.2.3", | ||
"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.", | ||
"version": "1.2.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.", | ||
"main": "src/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -24,3 +24,3 @@ "use strict"; | ||
let serviceBindingCache = {}; | ||
let serviceBindingCache = null; | ||
@@ -704,9 +704,12 @@ class EventQueueProcessorBase { | ||
async #getServiceBindings() { | ||
if (serviceBindingCache && serviceBindingCache.exipreTs >= Date.now()) { | ||
return serviceBindingCache.value; | ||
if (!(serviceBindingCache && serviceBindingCache.expireTs >= Date.now())) { | ||
const mtxServiceManager = require("@sap/cds-mtxs/srv/plugins/hana/srv-mgr"); | ||
serviceBindingCache = { | ||
expireTs: Date.now() + 10 * 60 * 1000, | ||
value: mtxServiceManager.getAll().catch(() => { | ||
serviceBindingCache = null; | ||
}), | ||
}; | ||
} | ||
const mtxServiceManager = require("@sap/cds-mtxs/srv/plugins/hana/srv-mgr"); | ||
serviceBindingCache.value = await mtxServiceManager.getAll(); | ||
serviceBindingCache.exipreTs = Date.now() + 10 * 60 * 1000; | ||
return serviceBindingCache.value; | ||
return await serviceBindingCache.value; | ||
} | ||
@@ -713,0 +716,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153503
3735