diff --git a/libs/sr/solver/src/parentWorker.ts b/libs/sr/solver/src/parentWorker.ts index 9ba86e895a..8ad301f5b6 100644 --- a/libs/sr/solver/src/parentWorker.ts +++ b/libs/sr/solver/src/parentWorker.ts @@ -134,9 +134,19 @@ async function start({ type: 'module', }) ) - // Wait for all workers to finish optimizing + let results: BuildResult[] = [] let numBuildsComputed = 0 + + // post initial progress + postMessage({ + resultType: 'progress', + progress: { + numBuildsKept: 0, + numBuildsComputed: 0, + }, + }) + // Wait for all workers to finish optimizing await Promise.all( workers.map((worker, index) => { return new Promise((res, rej) => { diff --git a/libs/zzz/page-optimize/src/WorkerSelector.tsx b/libs/zzz/page-optimize/src/WorkerSelector.tsx index cc29b004b9..61a5be19cf 100644 --- a/libs/zzz/page-optimize/src/WorkerSelector.tsx +++ b/libs/zzz/page-optimize/src/WorkerSelector.tsx @@ -16,7 +16,9 @@ export function WorkerSelector({ {range(1, maxWorkers).map((n) => ( setNumWorkers(n)}> - {t('workers', { count: n })} + {n} Workers + {/* TODO: Translation */} + {/* {t('workers', { count: n })} */} ))} diff --git a/libs/zzz/solver/src/parentWorker.ts b/libs/zzz/solver/src/parentWorker.ts index bafdfebba7..361ee0fb17 100644 --- a/libs/zzz/solver/src/parentWorker.ts +++ b/libs/zzz/solver/src/parentWorker.ts @@ -122,9 +122,19 @@ async function start({ type: 'module', }) ) - // Wait for all workers to finish optimizing + let results: BuildResult[] = [] let numBuildsComputed = 0 + // post initial progress + postMessage({ + resultType: 'progress', + progress: { + numBuildsKept: 0, + numBuildsComputed: 0, + }, + }) + + // Wait for all workers to finish optimizing await Promise.all( workers.map((worker, index) => { return new Promise((res, rej) => {