MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / backfillProject

Function backfillProject

packages/db/scripts/backfill-profile-seen.ts:106–130  ·  view source on GitHub ↗
(
  projectId: string,
  index: number,
  total: number
)

Source from the content-addressed store, hash-verified

104}
105
106async function backfillProject(
107 projectId: string,
108 index: number,
109 total: number
110) {
111 const t0 = Date.now();
112 const sql = buildSql();
113
114 if (dryRun) {
115 console.log(
116 `[backfill] [${index}/${total}] DRY RUN project=${projectId}\n${sql}\n`
117 );
118 return;
119 }
120
121 await ch.command({
122 query: sql,
123 query_params: { projectId },
124 });
125
126 const ms = Date.now() - t0;
127 console.log(
128 `[backfill] [${index}/${total}] project=${projectId} done in ${ms}ms`
129 );
130}
131
132async function main() {
133 const start = Date.now();

Callers 1

mainFunction · 0.85

Calls 2

buildSqlFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected