mirror of https://github.com/status-im/metro.git
Ensures that the Metro server is closed when an exception happens in runBuild
Differential Revision: D6924180 fbshipit-source-id: 80f5bf60aa357ce8df0598e8fdac92776c4af601
This commit is contained in:
parent
be528451f5
commit
cbaf70ce99
|
@ -320,7 +320,13 @@ exports.runBuild = async (options: RunBuildOptions) => {
|
|||
options.onBegin();
|
||||
}
|
||||
|
||||
const metroBundle = await output.build(metroServer, requestOptions);
|
||||
let metroBundle;
|
||||
|
||||
try {
|
||||
metroBundle = await output.build(metroServer, requestOptions);
|
||||
} finally {
|
||||
await metroServer.end();
|
||||
}
|
||||
|
||||
if (options.onComplete) {
|
||||
options.onComplete();
|
||||
|
@ -337,7 +343,6 @@ exports.runBuild = async (options: RunBuildOptions) => {
|
|||
};
|
||||
|
||||
await output.save(metroBundle, outputOptions, console.log);
|
||||
await metroServer.end();
|
||||
|
||||
return {metroServer, metroBundle};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue