Open History to see the last commit
1import { Pool } from "pg";
2import { runSession } from "../ingest/session";
3const pool = new Pool({
4 connectionString: process.env.DATABASE_URL,
5 max: 4,
6 connectionTimeoutMillis: 10000,
7 statement_timeout: 10000,
8});
9try {
10 do {
11 console.log(
12 await runSession(pool, {
13 budgetMs: Number(process.env.INGEST_REQUEST_BUDGET_MS ?? 240000),
14 tenureMs: Number(process.env.INGEST_TENURE_MS ?? 120000),
15 overlapMs: Number(process.env.INGEST_OVERLAP_MS ?? 90000),
16 smoothingMs: Number(process.env.INGEST_SMOOTHING_MS ?? 28000),
17 }),
18 );
19 if (!process.argv.includes("--watch")) break;
20 await new Promise((resolve) => setTimeout(resolve, 1000));
21 } while (true);
22} finally {
23 await pool.end();
24}