Write each backed-up original once and skip the precache (closes #106)
check / check (push) Successful in 57s
check / check (push) Successful in 57s
An original fetched for a backup is now written by the download writer straight into the backup's originals/, and the content cache records it there instead of keeping its own copy. One the cache already held is still copied. `quak backup` opens its library with the thumbnail and originals precache off, as the one-shot commands do. Model: opus-5-5
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
import {
|
||||
existsSync,
|
||||
mkdtempSync,
|
||||
readdirSync,
|
||||
readFileSync,
|
||||
rmSync,
|
||||
statSync,
|
||||
@@ -427,6 +428,16 @@ describe("backup", () => {
|
||||
expect(stdout.text).toBe("");
|
||||
});
|
||||
|
||||
// The backup opens its library with the precache off: it fetches the
|
||||
// originals it needs into the backup, and must not also fetch every
|
||||
// thumbnail in the account, or keep originals, in the per-user cache.
|
||||
it("leaves nothing in the cache's originals and thumbnails", async () => {
|
||||
const dir = join(root, "backup");
|
||||
expect(await backupCommand(context(), dir, {})).toBe(0);
|
||||
expect(readdirSync(join(root, "cache", "thumbnails"))).toEqual([]);
|
||||
expect(readdirSync(join(root, "cache", "originals"))).toEqual([]);
|
||||
});
|
||||
|
||||
it("exits 1 and lists the file when one download fails", async () => {
|
||||
const ctx = context(fakeClient({ failID: 101 }));
|
||||
expect(await backupCommand(ctx, join(root, "backup"), {})).toBe(1);
|
||||
|
||||
Reference in New Issue
Block a user