commit 685eaf083a0a9a81dca39a2de05a0f538a46b6f5
parent 2187ae28455faebfbc710830461457a7c3eb7a47
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 4 Nov 2026 14:54:33 -0500
umtool: a content-hash memo saves through a tmp of its own per save -- the deck's chunk plan and the encode may save the same memo
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/umtool/report-to-video/chunked-encode.mjs b/umtool/report-to-video/chunked-encode.mjs
@@ -238,7 +238,9 @@ export class HashMemo {
async save() {
if (!this.file || !this.dirty) return;
- const tmp = `${this.file}.${process.pid}.tmp`;
+ // A tmp of its own per save: a build may save while another save of the same memo is in flight.
+ HashMemo.saves = (HashMemo.saves ?? 0) + 1;
+ const tmp = `${this.file}.${process.pid}.${HashMemo.saves}.tmp`;
await writeFile(tmp, JSON.stringify({ v: 1, h: Object.fromEntries(this.map) }), "utf8");
await rename(tmp, this.file);
this.dirty = false;