backup-metadata: keep going when an ML data request fails (closes #101)
check / check (push) Successful in 26s

Each ML data request of up to 200 files is now tried on its own. A request
that still fails after its retries is logged, its files are written with the
reason in `mlDataError`, and the command exits 1 once the dump is complete.
`fetchMLData`, used only here, is removed in favour of a per-batch loop over
`fetchMLDataBatch`.

Model: opus-5-5
This commit is contained in:
2026-09-23 03:39:03 +00:00
parent d05b53d560
commit f051f9093b
6 changed files with 123 additions and 37 deletions
+2 -2
View File
@@ -323,11 +323,11 @@ export const backupMetadataCommand = async (
if (!client) return 1;
const lib = await openReadLibrary(ctx, client);
try {
await runMetadataBackup(lib, client, dir, {
const { failedMLBatches } = await runMetadataBackup(lib, client, dir, {
exif: opts.exif || opts.all,
onProgress: (msg) => ctx.stderr.write(msg + "\n"),
});
return 0;
return failedMLBatches > 0 ? 1 : 0;
} finally {
await lib.close();
}