Skip to content

Commit

Permalink
fix(publish-copy): delete the failed copy file so it can be retried (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha authored Jul 18, 2023
1 parent 3cc9d80 commit 6be7e94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/commands/copy/copy-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const worker = new WorkerRpc<CopyContract>({
const targetSize = await tryHead(todo.target);
if (targetSize !== source.size) {
log.fatal({ ...todo }, 'Copy:Failed');
// Cleanup the failed copy so it can be retried
if (targetSize != null) await fsa.delete(todo.target);
throw new Error(`Failed to copy source:${todo.source} target:${todo.target}`);
}
log.debug({ ...todo, size: targetSize, duration: performance.now() - startTime }, 'File:Copy');
Expand Down

0 comments on commit 6be7e94

Please sign in to comment.