Public: anyone can read this; the crew can change it.

The data volume has under 15% free #13570

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/13569-the-data-volume-has-under-15-free → main 1 commit fork

  • Merged. mason/13569-the-data-volume-has-under-15-free was merged into main as aca9c0c.

Review

Sign in to review this change.
3 files changed +24 −2
docs/features/disk-free.md +6
@@ -22,3 +22,9 @@ The hourly clone sweep (`src/crew/dispatch.ts`) also removes `node_modules` from
2222 an open issue or pull that nothing has touched for a day and no live run holds
2323 (`sweepIdleDependencies`, `src/crew/orphans.ts`). It is about two thirds of a clone; sources and
2424 `.git` stay, and `installDependencies` rebuilds it from the shared cache when a run resumes.
25
26 ## Run logs are kept a week (#13569)
27
28 `runs/` held 15 GiB at the last count. `pruneRunFiles` (`src/runs/prune.ts`) now removes a run
29 log or vitals file seven days after its last write, not fourteen; the run pages already say "no
30 log" for a missing one.
src/runs/prune.ts +1 −1
@@ -10,7 +10,7 @@ import { join } from "node:path";
1010 import { runsRoot } from "./log.ts";
1111
1212 /** Logs and vitals are kept this long after their last write. */
13 export const RUN_FILES_KEEP_MS = 14 * 86_400_000;
13 export const RUN_FILES_KEEP_MS = 7 * 86_400_000;
1414
1515 /** Remove the regular files of `runs/` last written before `now - maxAgeMs`; how many went. */
1616 export function pruneRunFiles(
test/run-prune.test.ts +17 −1
@@ -3,7 +3,7 @@ import { existsSync, mkdirSync, mkdtempSync, utimesSync, writeFileSync } from "n
33 import { join } from "node:path";
44 import { tmpdir } from "node:os";
55 import { runsRoot } from "../src/runs/log.ts";
6 import { pruneRunFiles } from "../src/runs/prune.ts";
6 import { pruneRunFiles, RUN_FILES_KEEP_MS } from "../src/runs/prune.ts";
77
88 test("old run files go, recent ones stay", () => {
99 const dir = mkdtempSync(join(tmpdir(), "prune-"));
@@ -22,3 +22,19 @@ test("old run files go, recent ones stay", () => {
2222 test("no runs directory is nothing to prune", () => {
2323 expect(pruneRunFiles(mkdtempSync(join(tmpdir(), "prune-")))).toBe(0);
2424 });
25
26 test("a log is kept a week after its last write (#13569)", () => {
27 expect(RUN_FILES_KEEP_MS).toBe(7 * 86_400_000);
28 const dir = mkdtempSync(join(tmpdir(), "prune-"));
29 mkdirSync(runsRoot(dir), { recursive: true });
30 const nine = join(runsRoot(dir), "nine.log");
31 const five = join(runsRoot(dir), "five.log");
32 writeFileSync(nine, "x");
33 writeFileSync(five, "x");
34 const at = (days: number) => new Date(Date.now() - days * 86_400_000);
35 utimesSync(nine, at(9), at(9));
36 utimesSync(five, at(5), at(5));
37 expect(pruneRunFiles(dir)).toBe(1);
38 expect(existsSync(nine)).toBe(false);
39 expect(existsSync(five)).toBe(true);
40 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs