account-lookup-service 17.2.0 → 17.2.1
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/CHANGELOG.md +7 -0
- package/package.json +7 -7
- package/src/handlers/index.js +12 -2
- package/src/handlers/monitoring/index.js +3 -4
- package/src/handlers/monitoring/plugins/health.js +1 -1
- package/src/handlers/register.js +4 -3
- package/src/lib/healthCheck/subServiceHealth.js +4 -5
- package/src/server.js +4 -2
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
4
4
|
|
5
|
+
### [17.2.1](https://github.com/mojaloop/account-lookup-service/compare/v17.2.0...v17.2.1) (2025-03-05)
|
6
|
+
|
7
|
+
|
8
|
+
### Bug Fixes
|
9
|
+
|
10
|
+
* **csi-1247:** added logs and process.on('uncaughtException') ([#527](https://github.com/mojaloop/account-lookup-service/issues/527)) ([c4b5e7d](https://github.com/mojaloop/account-lookup-service/commit/c4b5e7d834a76f78114863555f115a872eb2da0f))
|
11
|
+
|
5
12
|
## [17.2.0](https://github.com/mojaloop/account-lookup-service/compare/v17.1.0...v17.2.0) (2025-02-26)
|
6
13
|
|
7
14
|
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "account-lookup-service",
|
3
3
|
"description": "Account Lookup Service is used to validate Party and Participant lookups.",
|
4
|
-
"version": "17.2.
|
4
|
+
"version": "17.2.1",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"author": "ModusBox",
|
7
7
|
"contributors": [
|
@@ -88,20 +88,20 @@
|
|
88
88
|
"@hapi/boom": "10.0.1",
|
89
89
|
"@hapi/catbox-memory": "6.0.2",
|
90
90
|
"@hapi/good": "9.0.1",
|
91
|
-
"@hapi/hapi": "21.
|
91
|
+
"@hapi/hapi": "21.4.0",
|
92
92
|
"@hapi/inert": "7.1.0",
|
93
93
|
"@hapi/vision": "7.0.3",
|
94
|
-
"@mojaloop/central-services-error-handling": "13.0.
|
94
|
+
"@mojaloop/central-services-error-handling": "13.0.7",
|
95
95
|
"@mojaloop/central-services-health": "15.0.4",
|
96
96
|
"@mojaloop/central-services-logger": "11.5.5",
|
97
97
|
"@mojaloop/central-services-metrics": "12.4.5",
|
98
|
-
"@mojaloop/central-services-shared": "18.
|
98
|
+
"@mojaloop/central-services-shared": "18.21.0",
|
99
99
|
"@mojaloop/central-services-stream": "11.5.1",
|
100
100
|
"@mojaloop/database-lib": "11.1.3",
|
101
101
|
"@mojaloop/event-sdk": "14.1.5",
|
102
|
-
"@mojaloop/inter-scheme-proxy-cache-lib": "2.3.
|
103
|
-
"@mojaloop/ml-schema-transformer-lib": "2.5.
|
104
|
-
"@mojaloop/sdk-standard-components": "19.
|
102
|
+
"@mojaloop/inter-scheme-proxy-cache-lib": "2.3.7",
|
103
|
+
"@mojaloop/ml-schema-transformer-lib": "2.5.6",
|
104
|
+
"@mojaloop/sdk-standard-components": "19.9.0",
|
105
105
|
"@now-ims/hapi-now-auth": "2.1.0",
|
106
106
|
"ajv": "8.17.1",
|
107
107
|
"ajv-keywords": "5.1.0",
|
package/src/handlers/index.js
CHANGED
@@ -30,6 +30,7 @@
|
|
30
30
|
******/
|
31
31
|
'use strict'
|
32
32
|
|
33
|
+
const process = require('node:process')
|
33
34
|
const { Command } = require('commander')
|
34
35
|
const Package = require('../../package.json')
|
35
36
|
const Server = require('../server')
|
@@ -37,6 +38,15 @@ const { HANDLER_TYPES } = require('../constants')
|
|
37
38
|
const Config = require('../lib/config')
|
38
39
|
const log = require('../lib').logger.child('ALS-timeout-handler')
|
39
40
|
|
41
|
+
process.on('uncaughtExceptionMonitor', (err) => {
|
42
|
+
log.error(`uncaughtException: ${err?.message}`, err)
|
43
|
+
process.exit(2)
|
44
|
+
})
|
45
|
+
process.on('unhandledRejection', (err) => {
|
46
|
+
log.error(`unhandledRejection: ${err?.message}`, err)
|
47
|
+
process.exit(3)
|
48
|
+
})
|
49
|
+
|
40
50
|
const Program = new Command()
|
41
51
|
|
42
52
|
Program
|
@@ -51,12 +61,12 @@ Program.command('handlers')
|
|
51
61
|
const handlers = []
|
52
62
|
|
53
63
|
if (args.timeout) {
|
54
|
-
log.
|
64
|
+
log.verbose('CLI: Executing --timeout')
|
55
65
|
handlers.push(HANDLER_TYPES.TIMEOUT)
|
56
66
|
}
|
57
67
|
|
58
68
|
if (handlers.length === 0) {
|
59
|
-
log.
|
69
|
+
log.info('CLI: No handlers specified')
|
60
70
|
return
|
61
71
|
}
|
62
72
|
|
@@ -17,8 +17,7 @@
|
|
17
17
|
******/
|
18
18
|
const Hapi = require('@hapi/hapi')
|
19
19
|
const Metrics = require('@mojaloop/central-services-metrics')
|
20
|
-
const
|
21
|
-
const MetricsPlugin = require('@mojaloop/central-services-metrics').plugin
|
20
|
+
const healthPlugin = require('./plugins/health').plugin
|
22
21
|
const { logger } = require('../../lib')
|
23
22
|
|
24
23
|
let server
|
@@ -26,7 +25,7 @@ let server
|
|
26
25
|
const create = async ({ port, metricsConfig }) => {
|
27
26
|
Metrics.setup(metricsConfig)
|
28
27
|
server = new Hapi.Server({ port })
|
29
|
-
await server.register([
|
28
|
+
await server.register([healthPlugin, Metrics.plugin])
|
30
29
|
}
|
31
30
|
|
32
31
|
const start = async ({ enabled, port, metricsConfig, proxyCache }) => {
|
@@ -39,7 +38,7 @@ const start = async ({ enabled, port, metricsConfig, proxyCache }) => {
|
|
39
38
|
|
40
39
|
const stop = async () => {
|
41
40
|
await Promise.all([
|
42
|
-
server
|
41
|
+
server.stop(),
|
43
42
|
server.app.proxyCache?.disconnect()
|
44
43
|
])
|
45
44
|
server = null
|
@@ -20,8 +20,8 @@
|
|
20
20
|
|
21
21
|
const { HealthCheck } = require('@mojaloop/central-services-shared').HealthCheck
|
22
22
|
const { defaultHealthHandler } = require('@mojaloop/central-services-health')
|
23
|
-
const packageJson = require('../../../../package.json')
|
24
23
|
const { getProxyCacheHealth } = require('../../../lib/healthCheck/subServiceHealth')
|
24
|
+
const packageJson = require('../../../../package.json')
|
25
25
|
|
26
26
|
let healthCheck
|
27
27
|
|
package/src/handlers/register.js
CHANGED
@@ -47,17 +47,18 @@ const Monitoring = require('./monitoring')
|
|
47
47
|
const registerHandlers = async (handlers, options) => {
|
48
48
|
const { logger } = options
|
49
49
|
await init(options)
|
50
|
-
|
50
|
+
|
51
|
+
for (const handler of handlers) {
|
51
52
|
switch (handler) {
|
52
53
|
case HANDLER_TYPES.TIMEOUT:
|
53
54
|
logger.debug('Registering Timeout Handler')
|
54
|
-
TimeoutHandler.register(options)
|
55
|
+
await TimeoutHandler.register(options)
|
55
56
|
break
|
56
57
|
default:
|
57
58
|
logger.warn(`Handler ${handler} not found`)
|
58
59
|
break
|
59
60
|
}
|
60
|
-
}
|
61
|
+
}
|
61
62
|
}
|
62
63
|
|
63
64
|
/**
|
@@ -24,8 +24,7 @@
|
|
24
24
|
'use strict'
|
25
25
|
|
26
26
|
const { statusEnum, serviceName } = require('@mojaloop/central-services-shared').HealthCheck.HealthCheckEnums
|
27
|
-
const
|
28
|
-
|
27
|
+
const { logger } = require('../../lib')
|
29
28
|
const MigrationLockModel = require('../../models/misc/migrationLock')
|
30
29
|
|
31
30
|
/**
|
@@ -45,7 +44,7 @@ const getSubServiceHealthDatastore = async () => {
|
|
45
44
|
status = statusEnum.DOWN
|
46
45
|
}
|
47
46
|
} catch (err) {
|
48
|
-
|
47
|
+
logger.warn(`error in getSubServiceHealthDatastore: ${err?.message}`, err)
|
49
48
|
status = statusEnum.DOWN
|
50
49
|
}
|
51
50
|
|
@@ -63,12 +62,12 @@ const getSubServiceHealthDatastore = async () => {
|
|
63
62
|
* @returns Promise<SubServiceHealth> The SubService health object for the proxy cache
|
64
63
|
*/
|
65
64
|
const getProxyCacheHealth = async (proxyCache) => {
|
66
|
-
let status
|
65
|
+
let status
|
67
66
|
|
68
67
|
try {
|
69
68
|
status = await proxyCache.healthCheck() ? statusEnum.OK : statusEnum.DOWN
|
70
69
|
} catch (err) {
|
71
|
-
|
70
|
+
logger.warn(`error in getProxyCacheHealth: ${err?.message}`, err)
|
72
71
|
status = statusEnum.DOWN
|
73
72
|
}
|
74
73
|
|
package/src/server.js
CHANGED
@@ -33,6 +33,7 @@ const { Endpoints, Participants, proxies, OpenapiBackend } = require('@mojaloop/
|
|
33
33
|
const { createProxyCache } = require('@mojaloop/inter-scheme-proxy-cache-lib')
|
34
34
|
|
35
35
|
const { name, version } = require('../package.json')
|
36
|
+
const { logger } = require('./lib')
|
36
37
|
const Db = require('./lib/db')
|
37
38
|
const Util = require('./lib/util')
|
38
39
|
const Plugins = require('./plugins')
|
@@ -56,7 +57,8 @@ const createConnectedProxyCache = async (proxyCacheConfig) => {
|
|
56
57
|
proxyCacheConfig.type,
|
57
58
|
proxyCacheConfig.proxyConfig
|
58
59
|
)
|
59
|
-
await proxyCache.connect()
|
60
|
+
const connStatus = await proxyCache.connect()
|
61
|
+
logger.info('proxyCache connected', { connStatus, proxyCacheConfig })
|
60
62
|
return proxyCache
|
61
63
|
}
|
62
64
|
|
@@ -176,7 +178,7 @@ const initializeAdmin = async (appConfig) => {
|
|
176
178
|
|
177
179
|
const initializeHandlers = async (handlers, appConfig, logger) => {
|
178
180
|
const proxyCache = await createConnectedProxyCache(appConfig.PROXY_CACHE_CONFIG)
|
179
|
-
const options = { proxyCache, batchSize: appConfig.HANDLERS_TIMEOUT_BATCH_SIZE
|
181
|
+
const options = { proxyCache, logger, batchSize: appConfig.HANDLERS_TIMEOUT_BATCH_SIZE }
|
180
182
|
await Handlers.registerHandlers(handlers, options)
|
181
183
|
}
|
182
184
|
|