refactor(core): migrate to Bun and converge acquisition policies and Agent boundaries
This commit is contained in:
1 parent
3f1c6d02f6
commit
27c0f27434
268 files changed
+7468
-7852
No files matched your search
@@ -3,10 +3,10 @@
|
||||
// 默认只读(dry-run),加 --apply 才改库(单个事务,写一条审计 metadata.overview_recompute)。
|
||||
//
|
||||
// 用法(DATABASE_URL 必须显式给出,脚本不带默认库):
|
||||
// DATABASE_URL=postgres://umt:***@<host>:5432/umt deno run -A scripts/overview-recompute.ts # 看清单
|
||||
// DATABASE_URL=… deno run -A scripts/overview-recompute.ts --apply # 写库
|
||||
// DATABASE_URL=… deno run -A scripts/overview-recompute.ts --entity <作品 id> # 只看 / 只处理一部作品
|
||||
// DATABASE_URL=… deno run -A scripts/overview-recompute.ts --json # 清单输出 JSON
|
||||
// DATABASE_URL=postgres://umt:***@<host>:5432/umt bun scripts/overview-recompute.ts # 看清单
|
||||
// DATABASE_URL=… bun scripts/overview-recompute.ts --apply # 写库
|
||||
// DATABASE_URL=… bun scripts/overview-recompute.ts --entity <作品 id> # 只看 / 只处理一部作品
|
||||
// DATABASE_URL=… bun scripts/overview-recompute.ts --json # 清单输出 JSON
|
||||
//
|
||||
// 语言链与"简介是否允许回退到非中文"取库里的设置 metadata.languages / metadata.overviewNonChineseFallback。
|
||||
// 规则与实现见 apps/server/src/modules/sources-identity/service/overview-recompute.ts、docs/runbook/metadata.md。
|
||||
@@ -21,19 +21,19 @@ import {
|
||||
planOverviewRecompute,
|
||||
} from "../apps/server/src/modules/sources-identity/service/overview-recompute.ts";
|
||||
|
||||
const argv = [...Deno.args];
|
||||
const argv = [...process.argv.slice(2)];
|
||||
const APPLY = argv.includes("--apply");
|
||||
const JSON_OUT = argv.includes("--json");
|
||||
if (APPLY && argv.includes("--dry-run")) {
|
||||
console.error("--apply 与 --dry-run 不能同时给出");
|
||||
Deno.exit(2);
|
||||
process.exit(2);
|
||||
}
|
||||
const entityArg = argv.indexOf("--entity");
|
||||
const ONLY_ENTITY = entityArg >= 0 ? (argv[entityArg + 1] ?? null) : null;
|
||||
const url = Deno.env.get("DATABASE_URL");
|
||||
const url = process.env.DATABASE_URL;
|
||||
if (!url) {
|
||||
console.error("需要 DATABASE_URL(脚本不带默认库)");
|
||||
Deno.exit(2);
|
||||
process.exit(2);
|
||||
}
|
||||
const db = new Kysely<DB>({ dialect: new PostgresDialect({ pool: new pg.Pool({ connectionString: url, max: 2 }) }) });
|
||||
|
||||
|
||||
Reference in new issue
Block a user