Skip to content

Commit

A container app's old name that is removed once its redirect expires takes its Container application with it, rather than leaving it for nobody to pay for or remove.

Claude-Session:
https://claude.ai/code/session_01PnwTRSNaC7vEHTAuBzjhrn
Claudeagent and Claudeagentcommitted Parente851040Browse files
1 file+6−10/1 viewed
+6−1
25622562 for (const row of building.results) held.add(row.script);
25632563 const cutoff = Date.now() - ORPHAN_AFTER_MS;
25642564 for (const script of await cloudflare.listScripts()) {
2565− if (!held.has(script.id) && Date.parse(script.modified_on) < cutoff) await cloudflare.deleteScript(script.id);
2565+ if (!held.has(script.id) && Date.parse(script.modified_on) < cutoff) {
2566+ // A container app's old name (a redirect that expired) has its
2567+ // Container application still: it goes too.
2568+ await cloudflare.deleteContainer(script.id).catch((error) => console.error("could not remove container", script.id, error));
2569+ await cloudflare.deleteScript(script.id);
2570+ }
25662571 }
25672572 }
25682573