mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 05:03:57 +00:00
handle signals #192
This commit is contained in:
@@ -124,6 +124,18 @@ function start() {
|
|||||||
console.log('DbGate API listening on port', port);
|
console.log('DbGate API listening on port', port);
|
||||||
server.listen(port);
|
server.listen(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function shutdown() {
|
||||||
|
console.log('\nShutting down DbGate API server');
|
||||||
|
server.close( ()=> {
|
||||||
|
console.log('Server shut down, terminating');
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
process.on('SIGINT', shutdown);
|
||||||
|
process.on('SIGTERM', shutdown);
|
||||||
|
process.on('SIGBREAK', shutdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
function useAllControllers(app, electron) {
|
function useAllControllers(app, electron) {
|
||||||
|
|||||||
Reference in New Issue
Block a user