mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
handle signals #192
This commit is contained in:
parent
92d160b077
commit
66cac0665d
@ -124,6 +124,18 @@ function start() {
|
||||
console.log('DbGate API listening on port', 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user