Function
backfillProject
(
projectId: string,
index: number,
total: number
)
Source from the content-addressed store, hash-verified
| 104 | } |
| 105 | |
| 106 | async 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 | |
| 132 | async function main() { |
| 133 | const start = Date.now(); |
Tested by
no test coverage detected