refactor private property in health module
This commit is contained in:
parent
d9fc46513d
commit
9728ed69ab
|
@ -14,7 +14,7 @@ import { MessagePublisherPort } from '@libs/ports/message-publisher.port';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class RepositoriesHealthIndicatorUseCase extends HealthIndicator {
|
export class RepositoriesHealthIndicatorUseCase extends HealthIndicator {
|
||||||
private checkRepositories: CheckRepositoryPort[];
|
private _checkRepositories: CheckRepositoryPort[];
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(AD_REPOSITORY)
|
@Inject(AD_REPOSITORY)
|
||||||
private readonly adRepository: AdRepositoryPort,
|
private readonly adRepository: AdRepositoryPort,
|
||||||
|
@ -22,12 +22,12 @@ export class RepositoriesHealthIndicatorUseCase extends HealthIndicator {
|
||||||
private readonly messagePublisher: MessagePublisherPort,
|
private readonly messagePublisher: MessagePublisherPort,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.checkRepositories = [adRepository];
|
this._checkRepositories = [adRepository];
|
||||||
}
|
}
|
||||||
isHealthy = async (key: string): Promise<HealthIndicatorResult> => {
|
isHealthy = async (key: string): Promise<HealthIndicatorResult> => {
|
||||||
try {
|
try {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
this.checkRepositories.map(
|
this._checkRepositories.map(
|
||||||
async (checkRepository: CheckRepositoryPort) => {
|
async (checkRepository: CheckRepositoryPort) => {
|
||||||
await checkRepository.healthCheck();
|
await checkRepository.healthCheck();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue