keep a failed repo's pages and render it whole next run, while the other repos finish
Signed-off-by: dawn <90008@klbr.net>
91 unmodified lines929394959697989910010110210310458 unmodified lines1631641651661671681691701711723 unmodified lines17617717817917317417517617717817918018018118218318418518618118718318818919019119219399 unmodified lines91 unmodified lines let diffEntries = 0; for (const repo of hook.repos) { const prefix = prefixOf(repo); const summary = knownRepos[repo.did]; // a repo whose render failed last time keeps pages of an older run, maybe of another build if (summary?.failed) { plans.push({ repo, work: "all", weight: summary.pages ?? Infinity }); continue; } if (!full && summary && repo.change === "unchanged" && summary.prefix === prefix) { if (summary.generation === hook.generation) { nextRepos[repo.did] = summary; continue;58 unmodified lines Array.from({ length: workers }, () => runWorkerLoop(children, queue, takePlan, activeFamilies, familyOf, { hookPath, out, budget }, async (plan, result, wallMs) => { if (result.error) { failures.push(plan.repo.did); // its site link still names the pages of its last finished render nextRepos[plan.repo.did] = { failed: true, prefix: prefixOf(plan.repo), pages: knownRepos[plan.repo.did]?.pages }; status.repos[plan.repo.did] = { error: result.error }; } else { nextRepos[plan.repo.did] = { generation: hook.generation, prefix: prefixOf(plan.repo), pages: result.pages }; status.repos[plan.repo.did] = { ...result, wall_ms: wallMs };3 unmodified lines }) ) );
if (failures.length === 0) { await atomicJson(path.join(stateDir, "knot.json"), { knot_format: hook.format, renderer_format: RENDERER_FORMAT, build, generation: hook.generation, repos: nextRepos }); await atomicJson(path.join(stateDir, "knot.json"), { knot_format: hook.format, renderer_format: RENDERER_FORMAT, build, generation: hook.generation, repos: nextRepos }); } const summary = { state: failures.length === 0 ? "done" : "failed", state: failures.length === 0 ? "done" : "partial", failed: failures, finished_at: new Date().toISOString(), diff_entries: diffEntries, totals, total_ms: Math.round(performance.now() - t0)99 unmodified lines