Exit cleanly after flushing stdout
Summary: Using `process.exit()` stops the node process without waiting for the event loop to finish, so when using async i/o, which is what happens when piped, if the output is buffered, the process can terminate before it finishes flushing the buffer. This means you only get some of the output and the JSON is malformed. This fixes it by calling `process.exit()` inside the flushed callback. Reviewed By: passy Differential Revision: D15624806 fbshipit-source-id: ea540ed5a40fb1811e5b705b190da96c8e54730d
This commit is contained in:
committed by
Facebook Github Bot
parent
873475405a
commit
92edb82e13
@@ -90,4 +90,5 @@ export default (store: Store, logger: Logger) => {
|
||||
server.close();
|
||||
});
|
||||
}
|
||||
return server.close;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user