Reduce health check timeout and remove logging for health check status
This commit is contained in:
parent
ebe84fc757
commit
081cbb3410
@ -62,20 +62,14 @@ export class HealthService {
|
|||||||
try {
|
try {
|
||||||
const response = await firstValueFrom(
|
const response = await firstValueFrom(
|
||||||
this.httpService.get(url, {
|
this.httpService.get(url, {
|
||||||
timeout: 6000,
|
timeout: 500,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
status =
|
status =
|
||||||
response.status === 200 ? ServiceStatusEnum.UP : ServiceStatusEnum.DOWN;
|
response.status === 200 ? ServiceStatusEnum.UP : ServiceStatusEnum.DOWN;
|
||||||
|
|
||||||
this.logger.log(`Health check for ${serviceName}: ${status}`);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
status = ServiceStatusEnum.DOWN;
|
status = ServiceStatusEnum.DOWN;
|
||||||
|
|
||||||
this.logger.warn(
|
|
||||||
`Health check failed for ${serviceName}: ${error.message}`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (serviceName === 'default') {
|
if (serviceName === 'default') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user