Skip to content

Commit 09ab46d

Browse files
fix(cli): process hang when error happend in extract (#2349)
1 parent 3bd1384 commit 09ab46d

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

packages/cli/src/lingui-compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export async function command(
9494

9595
await pool.completed(true)
9696
} finally {
97-
await pool.terminate()
97+
await pool.terminate(true)
9898
}
9999
}
100100

packages/cli/src/lingui-extract-experimental.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default async function command(
120120

121121
await pool.completed()
122122
} finally {
123-
await pool.terminate()
123+
await pool.terminate(true)
124124
}
125125
} else {
126126
const format = await getFormat(

packages/cli/src/lingui-extract-template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default async function command(
6161
)
6262
} finally {
6363
if (workerPool) {
64-
await workerPool.terminate()
64+
await workerPool.terminate(true)
6565
}
6666
}
6767
Object.entries(catalogStats).forEach(([key, value]) => {

packages/cli/src/lingui-extract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default async function command(
7676
)
7777
} finally {
7878
if (workerPool) {
79-
await workerPool.terminate()
79+
await workerPool.terminate(true)
8080
}
8181
}
8282

packages/cli/test/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jest.mock("ora", () => {
2626
}
2727
})
2828

29-
function replaceDuration(snaphot: string) {
30-
return snaphot.replace(/Done in .+ms/g, "Done in <n>ms")
29+
function replaceDuration(snapshot: string) {
30+
return snapshot.replace(/Done in .+ms/g, "Done in <n>ms")
3131
}
3232
async function prepare(caseFolderName: string) {
3333
const rootDir = nodepath.join(__dirname, caseFolderName)

0 commit comments

Comments
 (0)