quak backup works on up to the content pool's limit of originals at once (closes #182) #192

Merged
clawbot merged 10 commits from issue-182-parallel-backup into next 2026-10-14 09:07:00 +02:00
Showing only changes of commit 4dc9e9e23c - Show all commits
+21
View File
@@ -909,6 +909,27 @@ describe("the backup lock", () => {
expect(existsSync(lockPath(outDir))).toBe(false); expect(existsSync(lockPath(outDir))).toBe(false);
await lib.close(); await lib.close();
}); });
// `runBackup` takes a library object from its caller. With a
// `contentConcurrency` below 1, or one that is not a number, it would
// back up no original and report no error. It rejects any that is not a
// positive integer, as `BoundedPool` does, before it takes the lock,
// which would create the download directory, and before it asks the
// library for anything: the object here has nothing else.
it("rejects a library whose contentConcurrency is not a positive integer, before taking the lock", async () => {
const outDir = join(root, "backup");
for (const contentConcurrency of [undefined, 0, -1, 1.5, NaN]) {
const lib = { contentConcurrency } as unknown as BackupLibrary;
await expect(
runBackup(lib, { downloadDirectory: outDir }),
).rejects.toThrow(
`contentConcurrency must be a positive integer, got ${contentConcurrency}`,
);
expect(existsSync(outDir)).toBe(false);
}
});
}); });
// Also serves ML data: file 100 has `ML_PAYLOAD`, the other two have none. // Also serves ML data: file 100 has `ML_PAYLOAD`, the other two have none.