Skip to content

Commit a3ee8f0

Browse files
committed
fix: stop chrome cluster when scan is finished
Fixes #246
1 parent c28fcc7 commit a3ee8f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/cli/src/cli.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ async function run() {
4040
process.exit(1)
4141
}
4242

43-
unlighthouse.hooks.hook('worker-finished', () => {
43+
unlighthouse.hooks.hook('worker-finished', async () => {
4444
const end = new Date()
4545
const seconds = Math.round((end.getTime() - start.getTime()) / 1000)
4646

4747
logger.success(`Unlighthouse has finished scanning \`${unlighthouse.resolvedConfig.site}\`: ${unlighthouse.worker.reports().length} routes in \`${seconds}s\`.`)
48+
await unlighthouse.worker.cluster.close().catch(() => {})
4849
})
4950

5051
if (unlighthouse.resolvedConfig.server.open)

0 commit comments

Comments
 (0)