refactor: make healthchecks less expensive

This commit is contained in:
Nicolas Meienberger
2025-11-20 18:50:40 +01:00
parent ef87ca816d
commit 0e4c302620
5 changed files with 14 additions and 32 deletions

View File

@@ -1,5 +1,4 @@
import * as fs from "node:fs/promises";
import * as npath from "node:path";
import { toMessage } from "../../../utils/errors";
import { logger } from "../../../utils/logger";
import type { VolumeBackend } from "../backend";
@@ -40,11 +39,6 @@ const checkHealth = async (config: BackendConfig) => {
try {
await fs.access(config.path);
// Try to create a temporary file to ensure write access
const tempFilePath = npath.join(config.path, `.healthcheck-${Date.now()}`);
await fs.writeFile(tempFilePath, "healthcheck");
await fs.unlink(tempFilePath);
return { status: BACKEND_STATUS.mounted };
} catch (error) {
logger.error("Directory health check failed:", error);