fix(backups): bridge local executor to Effect restic API
This commit is contained in:
parent
2686a82273
commit
0d723a46f2
1 changed files with 9 additions and 6 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { Effect } from "effect";
|
||||||
import { restic } from "../../core/restic";
|
import { restic } from "../../core/restic";
|
||||||
import type { BackupSchedule, Repository, Volume } from "../../db/schema";
|
import type { BackupSchedule, Repository, Volume } from "../../db/schema";
|
||||||
import type { ResticBackupOutputDto, ResticBackupProgressDto } from "@zerobyte/core/restic";
|
import type { ResticBackupOutputDto, ResticBackupProgressDto } from "@zerobyte/core/restic";
|
||||||
|
|
@ -55,12 +56,14 @@ export const backupExecutor = {
|
||||||
const volumePath = getVolumePath(volume);
|
const volumePath = getVolumePath(volume);
|
||||||
const backupOptions = createBackupOptions(schedule, volumePath, signal);
|
const backupOptions = createBackupOptions(schedule, volumePath, signal);
|
||||||
|
|
||||||
const result = await restic.backup(repository.config, volumePath, {
|
const result = await Effect.runPromise(
|
||||||
...backupOptions,
|
restic.backup(repository.config, volumePath, {
|
||||||
compressionMode: repository.compressionMode ?? "auto",
|
...backupOptions,
|
||||||
organizationId,
|
compressionMode: repository.compressionMode ?? "auto",
|
||||||
onProgress,
|
organizationId,
|
||||||
});
|
onProgress,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: "completed",
|
status: "completed",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue