@wrcb/cb-common 1.0.505 → 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.
- package/build/routes/health.js +3 -2
- package/package.json +1 -1
package/build/routes/health.js
CHANGED
|
@@ -97,7 +97,8 @@ function checkMongoDB() {
|
|
|
97
97
|
}
|
|
98
98
|
function checkNATS(natsWrapper) {
|
|
99
99
|
try {
|
|
100
|
-
|
|
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: '
|
|
109
|
+
return { status: 'unhealthy', message: 'not_connected' };
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
function checkWorkers(workers, isStartup = false) {
|