File tree Expand file tree Collapse file tree
services/apps/packages_worker/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ function monitor_workflow() {
273273 --workflow " $WORKFLOW_FILE " \
274274 --limit 1 \
275275 --json databaseId \
276- --jq ' .[0].databaseId' 2> /dev/null || echo " " )
276+ --jq ' .[0].databaseId // empty ' 2> /dev/null || echo " " )
277277
278278 if [[ -n " $CANDIDATE " ]] && ! echo " $EXISTING_IDS " | grep -q " ^${CANDIDATE} $" ; then
279279 RUN_ID=" $CANDIDATE "
Original file line number Diff line number Diff line change @@ -91,13 +91,13 @@ export async function rebuildVersionsIndexes(): Promise<{
9191 )
9292 const rebuilt : string [ ] = [ ]
9393
94- // Build indexes in parallel — each needs its own connection.
94+ // Build indexes in parallel — each on its own connection so they run concurrently .
9595 // maintenance_work_mem per connection: with 32 partitions and default 64MB, PG spills to
9696 // disk on every partition; 2GB lets the sort fit in RAM and cuts build time dramatically.
97- // Build indexes in parallel — each on its own connection so they run concurrently.
9897 await Promise . all (
9998 toRebuild . map ( async ( idx ) => {
10099 const conn = await getPackagesDb ( )
100+ await conn . result ( `SET LOCAL maintenance_work_mem = '2GB'` )
101101 log . info ( { columns : idx . columns } , 'Creating index on versions' )
102102 await conn . result ( idx . createSql )
103103 rebuilt . push ( idx . columns )
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ export async function ingestDependencies(opts: {
230230 runId : opts . runId ,
231231 syncMode : opts . syncMode ,
232232 snapshotAt : opts . today ,
233- maxBytesGb : opts . syncMode === 'full' ? 25000 : 10000 ,
233+ maxBytesGb : opts . syncMode === 'full' || isFill ? 25000 : 10000 ,
234234 reuseExports : opts . reuseExports ,
235235 exportName : opts . exportName ,
236236 ecosystems : opts . ecosystems ,
Original file line number Diff line number Diff line change 1212 * --concurrency <n> Partitions to process in parallel (default: 8).
1313 * --dry-run Count duplicates without deleting.
1414 */
15-
1615import { getServiceChildLogger } from '@crowd/logging'
1716
1817import { getPackagesDb } from '../db'
You can’t perform that action at this time.
0 commit comments