pruneRegistry
uses tcmts.registry.releases, which uses tcmts.server.table, which uses tcmts.server.Table, which uses #tcm/host (database)
Prune the registry's codebase (Store.prune): what a listed codebase named before it was mirrored again, or
before it was withdrawn, goes, and the history of mirroring with it. Every release's namespace stays (its code stays
for what uses it, withdrawn or yanked), and so does anything stored in the last hour (a mirror still fetching).
What it took out.
import { registryCodebase, releases } from "#codebase/tcmts/registry"; export async function pruneRegistry(): Promise<{ causals: number; namespaces: number; definitions: number; }> { const keep = (await releases.find()).map((r) => r.value.namespace); const pruned = registryCodebase().store.prune({ keep, since: Date.now() - 60 * 60 * 1000 }); if (pruned.definitions || pruned.namespaces) console.log( `registry: pruned ${pruned.definitions} definition(s) and ${pruned.namespaces} namespace(s) nothing names`, ); return pruned; }