@onlineapps/service-common 1.0.13 → 1.0.14
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
package/src/defaults.js
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
module.exports = {
|
|
13
13
|
infrastructureHealthQueueName: 'infrastructure.health.checks',
|
|
14
14
|
infrastructureHealthPublishIntervalMs: 5000,
|
|
15
|
-
infrastructureHealthWaitMaxTimeMs:
|
|
16
|
-
infrastructureHealthWaitCheckIntervalMs:
|
|
15
|
+
infrastructureHealthWaitMaxTimeMs: 60000,
|
|
16
|
+
infrastructureHealthWaitCheckIntervalMs: 2000,
|
|
17
17
|
infrastructureHealthTimeoutMs: 15000,
|
|
18
18
|
infrastructureHealthRedisTtlSeconds: 30,
|
|
19
19
|
infrastructureHealthCleanupIntervalMs: 10000,
|
|
@@ -35,8 +35,8 @@ const runtimeCfg = require('../config');
|
|
|
35
35
|
* Wait for all infrastructure services to be ready
|
|
36
36
|
* @param {Object} options - Options
|
|
37
37
|
* @param {string} [options.redisUrl] - Redis URL (default: REDIS_URL env or redis://api_node_cache:6379)
|
|
38
|
-
* @param {number} [options.maxWait] - Maximum wait time in ms (default: INFRASTRUCTURE_HEALTH_WAIT_MAX_TIME env or
|
|
39
|
-
* @param {number} [options.checkInterval] - Check interval in ms (default: INFRASTRUCTURE_HEALTH_WAIT_CHECK_INTERVAL env or
|
|
38
|
+
* @param {number} [options.maxWait] - Maximum wait time in ms (default: INFRASTRUCTURE_HEALTH_WAIT_MAX_TIME env or 60000 = 1 minute)
|
|
39
|
+
* @param {number} [options.checkInterval] - Check interval in ms (default: INFRASTRUCTURE_HEALTH_WAIT_CHECK_INTERVAL env or 2000 = 2 seconds)
|
|
40
40
|
* @param {Object} [options.logger] - Logger instance (default: console)
|
|
41
41
|
* @returns {Promise<boolean>} - True if all infrastructure services are ready
|
|
42
42
|
* @throws {Error} - If timeout is reached
|
|
@@ -8,8 +8,8 @@ describe('@onlineapps/service-common defaults @unit', () => {
|
|
|
8
8
|
test('should export stable module-owned defaults', () => {
|
|
9
9
|
expect(defaults.infrastructureHealthQueueName).toBe('infrastructure.health.checks');
|
|
10
10
|
expect(defaults.infrastructureHealthPublishIntervalMs).toBe(5000);
|
|
11
|
-
expect(defaults.infrastructureHealthWaitMaxTimeMs).toBe(
|
|
12
|
-
expect(defaults.infrastructureHealthWaitCheckIntervalMs).toBe(
|
|
11
|
+
expect(defaults.infrastructureHealthWaitMaxTimeMs).toBe(60000);
|
|
12
|
+
expect(defaults.infrastructureHealthWaitCheckIntervalMs).toBe(2000);
|
|
13
13
|
expect(defaults.infrastructureHealthTimeoutMs).toBe(15000);
|
|
14
14
|
expect(defaults.infrastructureHealthRedisTtlSeconds).toBe(30);
|
|
15
15
|
expect(defaults.infrastructureHealthCleanupIntervalMs).toBe(10000);
|