@wrcb/cb-common 1.0.506 → 1.0.507

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.
@@ -97,7 +97,8 @@ function checkMongoDB() {
97
97
  }
98
98
  function checkNATS(natsWrapper) {
99
99
  try {
100
- if (!natsWrapper.client) {
100
+ // Verificar se client existe sem tentar acessá-lo se não estiver pronto
101
+ if (!natsWrapper || typeof natsWrapper.client === 'undefined') {
101
102
  return { status: 'unhealthy', message: 'not_initialized' };
102
103
  }
103
104
  return natsWrapper.isClosed
@@ -105,7 +106,7 @@ function checkNATS(natsWrapper) {
105
106
  : { status: 'healthy', message: 'connected' };
106
107
  }
107
108
  catch (error) {
108
- return { status: 'unhealthy', message: 'error_checking' };
109
+ return { status: 'unhealthy', message: 'not_connected' };
109
110
  }
110
111
  }
111
112
  function checkWorkers(workers, isStartup = false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.506",
3
+ "version": "1.0.507",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",