Skip to content

Commit

Permalink
ZO minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
frzyc committed Jan 26, 2025
1 parent 27a9181 commit 4ea985a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
12 changes: 11 additions & 1 deletion libs/sr/solver/src/parentWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>((res, rej) => {
Expand Down
4 changes: 3 additions & 1 deletion libs/zzz/page-optimize/src/WorkerSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export function WorkerSelector({
<DropdownButton title={`${t('numWorkers')}: ${numWorkers}`}>
{range(1, maxWorkers).map((n) => (
<MenuItem key={n} onClick={() => setNumWorkers(n)}>
{t('workers', { count: n })}
{n} Workers
{/* TODO: Translation */}
{/* {t('workers', { count: n })} */}
</MenuItem>
))}
</DropdownButton>
Expand Down
12 changes: 11 additions & 1 deletion libs/zzz/solver/src/parentWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>((res, rej) => {
Expand Down

0 comments on commit 4ea985a

Please sign in to comment.