mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: enable restic cache
This commit is contained in:
@@ -139,8 +139,6 @@ const checkHealth = async (path: string) => {
|
||||
|
||||
const mount = await getMountForPath(path);
|
||||
|
||||
console.log(mount);
|
||||
|
||||
if (!mount || mount.fstype !== "fuse") {
|
||||
throw new Error(`Path ${path} is not mounted as WebDAV.`);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import { getStatFs, type StatFs } from "../../utils/mountinfo";
|
||||
import { createVolumeBackend } from "../backends/backend";
|
||||
import type { UpdateVolumeBody } from "./volume.dto";
|
||||
import { getVolumePath } from "./helpers";
|
||||
import { logger } from "../../utils/logger";
|
||||
|
||||
const listVolumes = async () => {
|
||||
const volumes = await db.query.volumesTable.findMany({});
|
||||
@@ -137,7 +138,7 @@ const updateVolume = async (name: string, volumeData: UpdateVolumeBody) => {
|
||||
JSON.stringify(existing.config) !== JSON.stringify(volumeData.config) && volumeData.config !== undefined;
|
||||
|
||||
if (configChanged) {
|
||||
console.log("Unmounting existing volume before applying new config");
|
||||
logger.debug("Unmounting existing volume before applying new config");
|
||||
const backend = createVolumeBackend(existing);
|
||||
await backend.unmount();
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@ const buildRepoUrl = (config: RepositoryConfig): string => {
|
||||
|
||||
const buildEnv = async (config: RepositoryConfig) => {
|
||||
const env: Record<string, string> = {
|
||||
RESTIC_CACHE_DIR: "/tmp/restic-cache",
|
||||
RESTIC_PASSWORD_FILE: RESTIC_PASS_FILE,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user