mirror of
https://github.com/appy-one/acebase-client.git
synced 2026-06-30 06:02:03 -06:00
add SIGINT handler to fix #32
This commit is contained in:
parent
fd49e57ec8
commit
88140478c1
1 changed files with 9 additions and 0 deletions
|
|
@ -342,6 +342,15 @@ export class AceBaseClient extends AceBaseBase {
|
|||
this.emit('ready');
|
||||
};
|
||||
|
||||
if (typeof process !== 'undefined') {
|
||||
// Enable graceful process exits, fixes #32
|
||||
process.on('SIGINT', () => {
|
||||
if (this.connected) {
|
||||
this.disconnect(); // Should be enough to exit process
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.api = new WebApi(settings.dbname, {
|
||||
network: settings.network,
|
||||
sync: settings.sync,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue