Fork Horse repository, listed by its owner. Publisher snapshot.

.forkhorse/quick/large-files.js

Snapshot at 34e3175

Containing directory

778 bytes · javascriptView raw
1// Unregistered stat API example for small snapshots. Repository-wide scans use
2// the full container check in .forkhorse/checks to avoid serial RPC deadlines.
3// Decimal MB; leave headroom below the provider's 32 MB per-file limit.
4const MAX_BYTES = 10_000_000;
5
6export default async (ctx) => {
7  for (const path of await ctx.list("")) {
8    const stat = await ctx.stat(path);
9    if (stat === null) return { ok: false, message: `File metadata is missing for ${path}.` };
10    if (stat.size >= MAX_BYTES) return {
11      ok: false,
12      message: `${path}: ${stat.size} bytes (10 MB or more); Artifacts limits each file to 32 MB. See docs/large-files.md.`,
13    };
14  }
15  return { ok: true, message: "All files are below 10 MB. See docs/large-files.md for Artifacts limits." };
16};
17