mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 11:56:00 +00:00
close chidl processes when parent exits
This commit is contained in:
@@ -27,7 +27,12 @@ module.exports = {
|
||||
},
|
||||
test(req, res) {
|
||||
const subprocess = fork(process.argv[1], ['connectProcess']);
|
||||
subprocess.on('message', (resp) => res.json(resp));
|
||||
subprocess.on('message', (resp) => {
|
||||
const { msgtype } = res;
|
||||
if (msgtype == 'connected' || msgtype == 'error') {
|
||||
res.json(resp);
|
||||
}
|
||||
});
|
||||
subprocess.send(req.body);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user