Каркас monorepo: scheduler, data_collector, khbuild_assistant_prep, khb_common; миграции; CI/CD
Some checks failed
ci / test (push) Failing after 20s
ci / deploy (push) Has been skipped

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 09:44:50 +03:00
commit ebb1cb7950
101 changed files with 4971 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { createLogger, createPool, loadServiceSettings } from "khb_common";
import { buildApi } from "./http-api.js";
import { runPrepJob } from "./jobs.js";
import { assistantPrepSchema } from "./settings.js";
const { common, service } = loadServiceSettings("khbuild_assistant_prep", assistantPrepSchema);
const log = createLogger("khbuild_assistant_prep", common.logLevel);
const pool = createPool(common.database.url);
const app = buildApi({
pool,
token: service.http.token,
run: (job, opts) =>
runPrepJob(
{
pool, log, common, requiredTables: service.requiredTables, maxSnapshotAgeMinutes: service.maxSnapshotAgeMinutes,
lookaheadWorkDays: service.lookaheadWorkDays, modes: service.modes, agent: service.agent,
},
job,
opts,
),
});
await app.listen({ host: service.http.host, port: service.http.port });
log.info({ port: service.http.port }, "khbuild_assistant_prep запущен");