From 842b271e6086621437220f589e9bf5be216ea531 Mon Sep 17 00:00:00 2001 From: Vijay Date: Thu, 9 Nov 2023 18:43:08 +0530 Subject: [PATCH 01/11] feat: added async queue for testing, need standardise if it works --- config/default.json | 3 ++- package-lock.json | 7 ++++--- package.json | 3 ++- src/handlers/parties/{Type}/{ID}.js | 22 ++++++++++++++++++++-- src/lib/config.js | 3 ++- 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/config/default.json b/config/default.json index 836bf149..d1fad98d 100644 --- a/config/default.json +++ b/config/default.json @@ -68,5 +68,6 @@ } }, "API_DOC_ENDPOINTS_ENABLED": true, - "FEATURE_ENABLE_EXTENDED_PARTY_ID_TYPE": false + "FEATURE_ENABLE_EXTENDED_PARTY_ID_TYPE": false, + "ASYNC_CONCURRENCY": 5 } diff --git a/package-lock.json b/package-lock.json index bdb571f0..34e736a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@now-ims/hapi-now-auth": "2.1.0", "ajv": "8.12.0", "ajv-keywords": "5.1.0", + "async": "^3.2.5", "blipp": "4.0.2", "commander": "11.1.0", "hapi-auth-bearer-token": "8.0.0", @@ -3415,9 +3416,9 @@ } }, "node_modules/async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" }, "node_modules/asynciterator.prototype": { "version": "1.0.0", diff --git a/package.json b/package.json index 37966f01..9d51c598 100644 --- a/package.json +++ b/package.json @@ -82,17 +82,18 @@ "@hapi/inert": "7.1.0", "@hapi/joi": "17.1.1", "@hapi/vision": "7.0.3", - "@mojaloop/database-lib": "11.0.3", "@mojaloop/central-services-error-handling": "12.0.7", "@mojaloop/central-services-health": "14.0.2", "@mojaloop/central-services-logger": "11.2.2", "@mojaloop/central-services-metrics": "12.0.8", "@mojaloop/central-services-shared": "18.0.0", + "@mojaloop/database-lib": "11.0.3", "@mojaloop/event-sdk": "14.0.0", "@mojaloop/sdk-standard-components": "17.1.3", "@now-ims/hapi-now-auth": "2.1.0", "ajv": "8.12.0", "ajv-keywords": "5.1.0", + "async": "^3.2.5", "blipp": "4.0.2", "commander": "11.1.0", "hapi-auth-bearer-token": "8.0.0", diff --git a/src/handlers/parties/{Type}/{ID}.js b/src/handlers/parties/{Type}/{ID}.js index c352b2e2..d72043d3 100644 --- a/src/handlers/parties/{Type}/{ID}.js +++ b/src/handlers/parties/{Type}/{ID}.js @@ -29,6 +29,16 @@ const EventSdk = require('@mojaloop/event-sdk') const LibUtil = require('../../../lib/util') const parties = require('../../../domain/parties') const Metrics = require('@mojaloop/central-services-metrics') +const Async = require('async') +const Config = require('../../../lib/config') + +var asyncQueue = Async.queue(function(task, callback) { + parties.getPartiesByTypeAndID(task.request.headers, task.request.params, task.request.method, task.request.query, task.span).then(() => { + callback(null) + }).catch((err) => { + callback(err) + }) +}, Config.ASYNC_CONCURRENCY) /** * Operations on /parties/{Type}/{ID} @@ -56,9 +66,17 @@ module.exports = { }, EventSdk.AuditEventAction.start) // Here we call an async function- but as we send an immediate sync response, _all_ errors // _must_ be handled by getPartiesByTypeAndID. - parties.getPartiesByTypeAndID(request.headers, request.params, request.method, request.query, span).catch(err => { - request.server.log(['error'], `ERROR - getPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`) + asyncQueue.push({ + request, + span + }, function(err) { + if(err) { + request.server.log(['error'], `ERROR - getPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`) + } }) + // parties.getPartiesByTypeAndID(request.headers, request.params, request.method, request.query, span).catch(err => { + // request.server.log(['error'], `ERROR - getPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`) + // }) histTimerEnd({ success: true }) return h.response().code(202) }, diff --git a/src/lib/config.js b/src/lib/config.js index 5f84a36e..3b81aae3 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -153,7 +153,8 @@ const config = { JWS_SIGNING_KEY_PATH: RC.ENDPOINT_SECURITY.JWS.JWS_SIGNING_KEY_PATH, API_DOC_ENDPOINTS_ENABLED: RC.API_DOC_ENDPOINTS_ENABLED || false, FEATURE_ENABLE_EXTENDED_PARTY_ID_TYPE: RC.FEATURE_ENABLE_EXTENDED_PARTY_ID_TYPE || false, - PROTOCOL_VERSIONS: getProtocolVersions(DEFAULT_PROTOCOL_VERSION, RC.PROTOCOL_VERSIONS) + PROTOCOL_VERSIONS: getProtocolVersions(DEFAULT_PROTOCOL_VERSION, RC.PROTOCOL_VERSIONS), + ASYNC_CONCURRENCY: RC.ASYNC_CONCURRENCY || 5, } if (config.JWS_SIGN) { From af842bde9a37b16a1f15f7f9749d63ac3da5b6d9 Mon Sep 17 00:00:00 2001 From: Vijay Date: Thu, 9 Nov 2023 21:24:52 +0530 Subject: [PATCH 02/11] feat: added a new async queue for put parties --- src/handlers/parties/{Type}/{ID}.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/handlers/parties/{Type}/{ID}.js b/src/handlers/parties/{Type}/{ID}.js index d72043d3..02114dd0 100644 --- a/src/handlers/parties/{Type}/{ID}.js +++ b/src/handlers/parties/{Type}/{ID}.js @@ -32,7 +32,7 @@ const Metrics = require('@mojaloop/central-services-metrics') const Async = require('async') const Config = require('../../../lib/config') -var asyncQueue = Async.queue(function(task, callback) { +var asyncQueue1 = Async.queue(function(task, callback) { parties.getPartiesByTypeAndID(task.request.headers, task.request.params, task.request.method, task.request.query, task.span).then(() => { callback(null) }).catch((err) => { @@ -40,6 +40,14 @@ var asyncQueue = Async.queue(function(task, callback) { }) }, Config.ASYNC_CONCURRENCY) +var asyncQueue2 = Async.queue(function(task, callback) { + parties.putPartiesByTypeAndID(task.request.headers, task.request.params, task.request.method, task.request.payload, task.request.dataUri).then(() => { + callback(null) + }).catch((err) => { + callback(err) + }) +}, Config.ASYNC_CONCURRENCY) + /** * Operations on /parties/{Type}/{ID} */ @@ -66,7 +74,7 @@ module.exports = { }, EventSdk.AuditEventAction.start) // Here we call an async function- but as we send an immediate sync response, _all_ errors // _must_ be handled by getPartiesByTypeAndID. - asyncQueue.push({ + asyncQueue1.push({ request, span }, function(err) { @@ -103,9 +111,17 @@ module.exports = { }, EventSdk.AuditEventAction.start) // Here we call an async function- but as we send an immediate sync response, _all_ errors // _must_ be handled by putPartiesByTypeAndID. - parties.putPartiesByTypeAndID(request.headers, request.params, request.method, request.payload, request.dataUri).catch(err => { - request.server.log(['error'], `ERROR - putPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`) + asyncQueue2.push({ + request, + span + }, function(err) { + if(err) { + request.server.log(['error'], `ERROR - putPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`) + } }) + // parties.putPartiesByTypeAndID(request.headers, request.params, request.method, request.payload, request.dataUri).catch(err => { + // request.server.log(['error'], `ERROR - putPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`) + // }) histTimerEnd({ success: true }) return h.response().code(200) } From 88f8eeec44f5d591bcc07ac3dc917fc137e2a36d Mon Sep 17 00:00:00 2001 From: Vijay Kumar Guthi Date: Fri, 10 Nov 2023 07:10:04 +0000 Subject: [PATCH 03/11] feat: passed values instead of refs --- src/handlers/parties/{Type}/{ID}.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/handlers/parties/{Type}/{ID}.js b/src/handlers/parties/{Type}/{ID}.js index 02114dd0..d3300d22 100644 --- a/src/handlers/parties/{Type}/{ID}.js +++ b/src/handlers/parties/{Type}/{ID}.js @@ -33,7 +33,7 @@ const Async = require('async') const Config = require('../../../lib/config') var asyncQueue1 = Async.queue(function(task, callback) { - parties.getPartiesByTypeAndID(task.request.headers, task.request.params, task.request.method, task.request.query, task.span).then(() => { + parties.getPartiesByTypeAndID(task.headers, task.params, task.method, task.query, task.span).then(() => { callback(null) }).catch((err) => { callback(err) @@ -41,7 +41,7 @@ var asyncQueue1 = Async.queue(function(task, callback) { }, Config.ASYNC_CONCURRENCY) var asyncQueue2 = Async.queue(function(task, callback) { - parties.putPartiesByTypeAndID(task.request.headers, task.request.params, task.request.method, task.request.payload, task.request.dataUri).then(() => { + parties.putPartiesByTypeAndID(task.headers, task.params, task.method, task.payload, task.dataUri).then(() => { callback(null) }).catch((err) => { callback(err) @@ -75,7 +75,10 @@ module.exports = { // Here we call an async function- but as we send an immediate sync response, _all_ errors // _must_ be handled by getPartiesByTypeAndID. asyncQueue1.push({ - request, + headers: { ...request.headers }, + params: { ...request.params }, + method: request.method, + query: { ...request.query }, span }, function(err) { if(err) { @@ -112,8 +115,11 @@ module.exports = { // Here we call an async function- but as we send an immediate sync response, _all_ errors // _must_ be handled by putPartiesByTypeAndID. asyncQueue2.push({ - request, - span + headers: { ...request.headers }, + params: { ...request.params }, + method: request.method, + payload: { ...request.payload }, + dataUri: request.dataUri }, function(err) { if(err) { request.server.log(['error'], `ERROR - putPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`) From efec0765c5dd10ae156576f2a0a6be202cb72b15 Mon Sep 17 00:00:00 2001 From: Vijay Date: Wed, 6 Dec 2023 18:48:23 +0530 Subject: [PATCH 04/11] chore: updated deps and fixed lint --- package-lock.json | 27 +++++++++------------------ package.json | 4 ++-- src/handlers/parties/{Type}/{ID}.js | 12 ++++++------ src/lib/config.js | 2 +- 4 files changed, 18 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9a0785cf..ae2db258 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "uuid4": "2.0.3" }, "devDependencies": { - "@types/jest": "29.5.10", + "@types/jest": "29.5.11", "audit-ci": "^6.6.1", "axios": "1.6.2", "docdash": "2.0.2", @@ -50,7 +50,7 @@ "jest": "29.7.0", "jest-junit": "16.0.0", "jsdoc": "4.0.2", - "nodemon": "3.0.1", + "nodemon": "3.0.2", "npm-audit-resolver": "3.0.0-RC.0", "npm-check-updates": "16.14.11", "nyc": "15.1.0", @@ -2902,9 +2902,9 @@ } }, "node_modules/@types/jest": { - "version": "29.5.10", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.10.tgz", - "integrity": "sha512-tE4yxKEphEyxj9s4inideLHktW/x6DwesIwWZ9NN1FKf9zbJYsnhBoA9vrHA/IuIOKwPa5PcFBNV4lpMIOEzyQ==", + "version": "29.5.11", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.11.tgz", + "integrity": "sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -11292,13 +11292,13 @@ "dev": true }, "node_modules/nodemon": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.1.tgz", - "integrity": "sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.2.tgz", + "integrity": "sha512-9qIN2LNTrEzpOPBaWHTm4Asy1LxXLSickZStAQ4IZe7zsoIpD/A7LWxhZV3t4Zu352uBcqVnRsDXSMR2Sc3lTA==", "dev": true, "dependencies": { "chokidar": "^3.5.2", - "debug": "^3.2.7", + "debug": "^4", "ignore-by-default": "^1.0.1", "minimatch": "^3.1.2", "pstree.remy": "^1.1.8", @@ -11319,15 +11319,6 @@ "url": "https://opencollective.com/nodemon" } }, - "node_modules/nodemon/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, "node_modules/nodemon/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", diff --git a/package.json b/package.json index 4268830f..d6413f71 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "uuid4": "2.0.3" }, "devDependencies": { - "@types/jest": "29.5.10", + "@types/jest": "29.5.11", "audit-ci": "^6.6.1", "axios": "1.6.2", "docdash": "2.0.2", @@ -116,7 +116,7 @@ "jest": "29.7.0", "jest-junit": "16.0.0", "jsdoc": "4.0.2", - "nodemon": "3.0.1", + "nodemon": "3.0.2", "npm-audit-resolver": "3.0.0-RC.0", "npm-check-updates": "16.14.11", "nyc": "15.1.0", diff --git a/src/handlers/parties/{Type}/{ID}.js b/src/handlers/parties/{Type}/{ID}.js index d3300d22..6d13f811 100644 --- a/src/handlers/parties/{Type}/{ID}.js +++ b/src/handlers/parties/{Type}/{ID}.js @@ -32,7 +32,7 @@ const Metrics = require('@mojaloop/central-services-metrics') const Async = require('async') const Config = require('../../../lib/config') -var asyncQueue1 = Async.queue(function(task, callback) { +const asyncQueue1 = Async.queue(function (task, callback) { parties.getPartiesByTypeAndID(task.headers, task.params, task.method, task.query, task.span).then(() => { callback(null) }).catch((err) => { @@ -40,7 +40,7 @@ var asyncQueue1 = Async.queue(function(task, callback) { }) }, Config.ASYNC_CONCURRENCY) -var asyncQueue2 = Async.queue(function(task, callback) { +const asyncQueue2 = Async.queue(function (task, callback) { parties.putPartiesByTypeAndID(task.headers, task.params, task.method, task.payload, task.dataUri).then(() => { callback(null) }).catch((err) => { @@ -80,8 +80,8 @@ module.exports = { method: request.method, query: { ...request.query }, span - }, function(err) { - if(err) { + }, function (err) { + if (err) { request.server.log(['error'], `ERROR - getPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`) } }) @@ -120,8 +120,8 @@ module.exports = { method: request.method, payload: { ...request.payload }, dataUri: request.dataUri - }, function(err) { - if(err) { + }, function (err) { + if (err) { request.server.log(['error'], `ERROR - putPartiesByTypeAndID: ${LibUtil.getStackOrInspect(err)}`) } }) diff --git a/src/lib/config.js b/src/lib/config.js index c1d8f268..6d008d6e 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -156,7 +156,7 @@ const config = { API_DOC_ENDPOINTS_ENABLED: RC.API_DOC_ENDPOINTS_ENABLED || false, FEATURE_ENABLE_EXTENDED_PARTY_ID_TYPE: RC.FEATURE_ENABLE_EXTENDED_PARTY_ID_TYPE || false, PROTOCOL_VERSIONS: getProtocolVersions(DEFAULT_PROTOCOL_VERSION, RC.PROTOCOL_VERSIONS), - ASYNC_CONCURRENCY: RC.ASYNC_CONCURRENCY || 5, + ASYNC_CONCURRENCY: RC.ASYNC_CONCURRENCY || 5 } if (config.JWS_SIGN) { From 6072a7b09c804d92608e75f4bf8d299a16dcfd1b Mon Sep 17 00:00:00 2001 From: Vijay Date: Wed, 6 Dec 2023 18:48:58 +0530 Subject: [PATCH 05/11] chore(snapshot): 15.3.0-snapshot.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index ae2db258..c398ffce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "account-lookup-service", - "version": "15.2.0", + "version": "15.3.0-snapshot.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "account-lookup-service", - "version": "15.2.0", + "version": "15.3.0-snapshot.0", "license": "Apache-2.0", "dependencies": { "@hapi/basic": "7.0.2", diff --git a/package.json b/package.json index d6413f71..5f2cc932 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "account-lookup-service", "description": "Account Lookup Service is used to validate Party and Participant lookups.", - "version": "15.2.0", + "version": "15.3.0-snapshot.0", "license": "Apache-2.0", "author": "ModusBox", "contributors": [ From 72a286ad8ce777b250f3f727c4b0b3d4b8ecccf2 Mon Sep 17 00:00:00 2001 From: Vijay Date: Wed, 6 Dec 2023 22:54:56 +0530 Subject: [PATCH 06/11] fix: oracleCache --- src/server.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server.js b/src/server.js index 858afcd3..1ae31fba 100644 --- a/src/server.js +++ b/src/server.js @@ -41,6 +41,7 @@ const Migrator = require('./lib/migrator') const Handlers = require('./handlers') const Routes = require('./handlers/routes') const Cache = require('./lib/cache') +const OracleEndpointCache = require('./models/oracle/oracleEndpointCached') const connectDatabase = async () => { return Db.connect(Config.DATABASE) @@ -119,6 +120,7 @@ const initializeApi = async (port = Config.API_PORT) => { Logger.isInfoEnabled && Logger.info(`Server running on ${server.info.host}:${server.info.port}`) await ParticipantEndpointCache.initializeCache(Config.CENTRAL_SHARED_ENDPOINT_CACHE_CONFIG) await ParticipantCache.initializeCache(Config.CENTRAL_SHARED_PARTICIPANT_CACHE_CONFIG) + await OracleEndpointCache.initialize() return server } From f06ac910365d8367a919c8b7ebc65a5e8a9cc002 Mon Sep 17 00:00:00 2001 From: Vijay Date: Wed, 6 Dec 2023 22:57:26 +0530 Subject: [PATCH 07/11] chore(snapshot): 15.3.0-snapshot.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c398ffce..f412f62a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "account-lookup-service", - "version": "15.3.0-snapshot.0", + "version": "15.3.0-snapshot.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "account-lookup-service", - "version": "15.3.0-snapshot.0", + "version": "15.3.0-snapshot.1", "license": "Apache-2.0", "dependencies": { "@hapi/basic": "7.0.2", diff --git a/package.json b/package.json index 5f2cc932..574df4df 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "account-lookup-service", "description": "Account Lookup Service is used to validate Party and Participant lookups.", - "version": "15.3.0-snapshot.0", + "version": "15.3.0-snapshot.1", "license": "Apache-2.0", "author": "ModusBox", "contributors": [ From bf2a5ff426bd408bcf8af6660ce508466407e683 Mon Sep 17 00:00:00 2001 From: Vijay Date: Thu, 7 Dec 2023 00:20:46 +0530 Subject: [PATCH 08/11] fix: cache init --- src/server.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server.js b/src/server.js index 1ae31fba..d634688e 100644 --- a/src/server.js +++ b/src/server.js @@ -42,6 +42,7 @@ const Handlers = require('./handlers') const Routes = require('./handlers/routes') const Cache = require('./lib/cache') const OracleEndpointCache = require('./models/oracle/oracleEndpointCached') +const Cache = require('./lib/cache') const connectDatabase = async () => { return Db.connect(Config.DATABASE) @@ -121,6 +122,7 @@ const initializeApi = async (port = Config.API_PORT) => { await ParticipantEndpointCache.initializeCache(Config.CENTRAL_SHARED_ENDPOINT_CACHE_CONFIG) await ParticipantCache.initializeCache(Config.CENTRAL_SHARED_PARTICIPANT_CACHE_CONFIG) await OracleEndpointCache.initialize() + await Cache.initCache() return server } From 360dde68ce930fb7913a99e95c87aa75428b3540 Mon Sep 17 00:00:00 2001 From: Vijay Date: Thu, 7 Dec 2023 00:20:53 +0530 Subject: [PATCH 09/11] chore(snapshot): 15.3.0-snapshot.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f412f62a..61f505c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "account-lookup-service", - "version": "15.3.0-snapshot.1", + "version": "15.3.0-snapshot.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "account-lookup-service", - "version": "15.3.0-snapshot.1", + "version": "15.3.0-snapshot.2", "license": "Apache-2.0", "dependencies": { "@hapi/basic": "7.0.2", diff --git a/package.json b/package.json index 574df4df..f96cbb66 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "account-lookup-service", "description": "Account Lookup Service is used to validate Party and Participant lookups.", - "version": "15.3.0-snapshot.1", + "version": "15.3.0-snapshot.2", "license": "Apache-2.0", "author": "ModusBox", "contributors": [ From 093ba164a7cdd8a3dea2b10b4dc2a0bbf6cd6b63 Mon Sep 17 00:00:00 2001 From: Vijay Date: Thu, 7 Dec 2023 00:37:25 +0530 Subject: [PATCH 10/11] fix: cache --- src/server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server.js b/src/server.js index d634688e..bf1a9332 100644 --- a/src/server.js +++ b/src/server.js @@ -42,7 +42,6 @@ const Handlers = require('./handlers') const Routes = require('./handlers/routes') const Cache = require('./lib/cache') const OracleEndpointCache = require('./models/oracle/oracleEndpointCached') -const Cache = require('./lib/cache') const connectDatabase = async () => { return Db.connect(Config.DATABASE) From 564f4518c0b0d4ea78e14e2c3bdd2b8acaa508ed Mon Sep 17 00:00:00 2001 From: Vijay Date: Thu, 7 Dec 2023 00:46:30 +0530 Subject: [PATCH 11/11] fix: cache --- src/models/oracle/oracleEndpointCached.js | 3 ++- src/server.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/models/oracle/oracleEndpointCached.js b/src/models/oracle/oracleEndpointCached.js index cd88220a..5b3b665c 100644 --- a/src/models/oracle/oracleEndpointCached.js +++ b/src/models/oracle/oracleEndpointCached.js @@ -76,7 +76,8 @@ const getOracleEndpointCached = async (params) => { exports.initialize = async () => { /* Register as cache client */ const oracleEndpointCacheClientMeta = { - id: 'oracleEndpoints' + id: 'oracleEndpoints', + preloadCache: async () => Promise.resolve() } cacheClient = Cache.registerCacheClient(oracleEndpointCacheClientMeta) diff --git a/src/server.js b/src/server.js index bf1a9332..9ec5d6e3 100644 --- a/src/server.js +++ b/src/server.js @@ -78,7 +78,8 @@ const createServer = async (port, api, routes, isAdmin) => { } }) server.app.cache = Cache.registerCacheClient({ - id: 'serverGeneralCache' + id: 'serverGeneralCache', + preloadCache: async () => Promise.resolve() }) await Plugins.registerPlugins(server, api, isAdmin) await server.ext([