Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame contribute delete
630 Bytes
import { Injectable } from "@nestjs/common";
import { HealthIndicator, HealthIndicatorResult } from "@nestjs/terminus";
import { StorageService } from "../storage/storage.service";
@Injectable()
export class StorageHealthIndicator extends HealthIndicator {
constructor(private readonly storageService: StorageService) {
super();
}
async isHealthy(): Promise<HealthIndicatorResult> {
try {
await this.storageService.bucketExists();
return this.getStatus("storage", true);
} catch (error: unknown) {
return this.getStatus("storage", false, { message: (error as Error).message });
}
}
}