mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 14:16:01 +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);
|
||||
},
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ module.exports = {
|
||||
resolve(response);
|
||||
delete this.requests[msgid];
|
||||
},
|
||||
handle_ping() {},
|
||||
|
||||
async ensureOpened(conid, database) {
|
||||
const existing = this.opened.find((x) => x.conid == conid && x.database == database);
|
||||
|
||||
@@ -14,6 +14,8 @@ module.exports = {
|
||||
handle_error(conid, { error }) {
|
||||
console.log(`Error in server connection ${conid}: ${error}`);
|
||||
},
|
||||
handle_ping() {
|
||||
},
|
||||
|
||||
async ensureOpened(conid) {
|
||||
const existing = this.opened.find(x => x.conid == conid);
|
||||
|
||||
@@ -58,6 +58,8 @@ module.exports = {
|
||||
jsldata.notifyChangedStats(stats);
|
||||
},
|
||||
|
||||
handle_ping() {},
|
||||
|
||||
create_meta: 'post',
|
||||
async create({ conid, database }) {
|
||||
const sesid = uuidv1();
|
||||
|
||||
Reference in New Issue
Block a user