mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 07:34:54 +00:00
health check
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import {
|
||||
HealthCheck,
|
||||
HealthCheckService,
|
||||
@ -8,6 +9,7 @@ import {
|
||||
HttpHealthIndicator,
|
||||
} from '@nestjs/terminus';
|
||||
|
||||
@ApiTags('Health Module')
|
||||
@Controller('health')
|
||||
export class HealthController {
|
||||
constructor(
|
||||
@ -29,7 +31,7 @@ export class HealthController {
|
||||
path: '/',
|
||||
}),
|
||||
() => this.memory.checkHeap('memory_heap', 300 * 1024 * 1024),
|
||||
() => this.http.pingCheck('tuya', 'https://openapi.tuya.com'),
|
||||
() => this.http.pingCheck('tuya', process.env.TUYA_EU_URL),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,9 +3,9 @@ import { Module } from '@nestjs/common';
|
||||
import { TerminusModule } from '@nestjs/terminus';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { HealthController } from './controllers';
|
||||
|
||||
import { HttpModule } from '@nestjs/axios';
|
||||
@Module({
|
||||
imports: [TerminusModule, TypeOrmModule],
|
||||
imports: [TerminusModule, HttpModule, TypeOrmModule],
|
||||
controllers: [HealthController],
|
||||
})
|
||||
export class HealthModule {}
|
||||
|
||||
Reference in New Issue
Block a user