mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-20 18:17:51 +02:00
fix: handle SIGTERM in build command (#5813)
This commit is contained in:
parent
96da25e422
commit
768600e5d9
2 changed files with 5 additions and 1 deletions
|
@ -36,6 +36,10 @@ export default async function build(
|
||||||
// TODO what's the purpose of this arg ?
|
// TODO what's the purpose of this arg ?
|
||||||
forceTerminate: boolean = true,
|
forceTerminate: boolean = true,
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
|
['SIGINT', 'SIGTERM'].forEach((sig) => {
|
||||||
|
process.on(sig, () => process.exit());
|
||||||
|
});
|
||||||
|
|
||||||
async function tryToBuildLocale({
|
async function tryToBuildLocale({
|
||||||
locale,
|
locale,
|
||||||
isLastLocale,
|
isLastLocale,
|
||||||
|
|
|
@ -232,7 +232,7 @@ export default async function start(
|
||||||
});
|
});
|
||||||
|
|
||||||
['SIGINT', 'SIGTERM'].forEach((sig) => {
|
['SIGINT', 'SIGTERM'].forEach((sig) => {
|
||||||
process.on(sig as NodeJS.Signals, () => {
|
process.on(sig, () => {
|
||||||
devServer.close();
|
devServer.close();
|
||||||
process.exit();
|
process.exit();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue