chore: fix liniting issues
This commit is contained in:
parent
4074a505b1
commit
6b83864158
2 changed files with 10 additions and 8 deletions
|
|
@ -48,11 +48,13 @@ test("cancelBackup resolves a running backup when the cancel command cannot be d
|
||||||
});
|
});
|
||||||
|
|
||||||
test("runVolumeCommand sends the command to the selected agent", async () => {
|
test("runVolumeCommand sends the command to the selected agent", async () => {
|
||||||
const runVolumeCommand = vi.fn().mockResolvedValue({
|
const runVolumeCommand = vi.fn(() =>
|
||||||
commandId: "command-1",
|
Effect.succeed({
|
||||||
status: "success",
|
commandId: "command-1",
|
||||||
command: { name: "volume.mount", result: { status: "mounted" } },
|
status: "success",
|
||||||
});
|
command: { name: "volume.mount", result: { status: "mounted" } },
|
||||||
|
}),
|
||||||
|
);
|
||||||
setAgentRuntime({ runVolumeCommand });
|
setAgentRuntime({ runVolumeCommand });
|
||||||
|
|
||||||
const command = fromPartial<VolumeCommand>({ name: "volume.mount", volume: { agentId: "agent-1" } });
|
const command = fromPartial<VolumeCommand>({ name: "volume.mount", volume: { agentId: "agent-1" } });
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { logger } from "@zerobyte/core/node";
|
||||||
import { toMessage } from "@zerobyte/core/utils";
|
import { toMessage } from "@zerobyte/core/utils";
|
||||||
import type { BackendConfig, VolumeBackend } from "../types";
|
import type { BackendConfig, VolumeBackend } from "../types";
|
||||||
|
|
||||||
const mount = async (config: BackendConfig, volumePath: string) => {
|
const mount = async (config: BackendConfig) => {
|
||||||
if (config.backend !== "directory") {
|
if (config.backend !== "directory") {
|
||||||
return { status: "error" as const, error: "Invalid backend type" };
|
return { status: "error" as const, error: "Invalid backend type" };
|
||||||
}
|
}
|
||||||
|
|
@ -45,8 +45,8 @@ const checkHealth = async (config: BackendConfig) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const makeDirectoryBackend = (config: BackendConfig, volumePath: string): VolumeBackend => ({
|
export const makeDirectoryBackend = (config: BackendConfig, _: string): VolumeBackend => ({
|
||||||
mount: () => mount(config, volumePath),
|
mount: () => mount(config),
|
||||||
unmount,
|
unmount,
|
||||||
checkHealth: () => checkHealth(config),
|
checkHealth: () => checkHealth(config),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue