@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/service-common",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Common utilities for both infrastructure services and business services",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
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: 300000,
16
- infrastructureHealthWaitCheckIntervalMs: 5000,
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 300000 = 5 minutes)
39
- * @param {number} [options.checkInterval] - Check interval in ms (default: INFRASTRUCTURE_HEALTH_WAIT_CHECK_INTERVAL env or 5000 = 5 seconds)
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(300000);
12
- expect(defaults.infrastructureHealthWaitCheckIntervalMs).toBe(5000);
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);