Skip to content

Commit

Permalink
Refactor: ignore temp cache file move failures (#1319)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Aug 28, 2024
1 parent 6126d77 commit 02b0f61
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/types/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ export default class Cache<V> {
}

// Overwrite the real file with the temp file
await FsPoly.mv(tempFile, this.filePath);
try {
await FsPoly.mv(tempFile, this.filePath);
} catch {
return;
}
this.hasChanged = false;
this.saveMutex.cancel(); // cancel all waiting locks, we just saved
});
Expand Down

0 comments on commit 02b0f61

Please sign in to comment.