mirror of
https://gitlab.com/jusax23/dnc.git
synced 2024-11-22 06:36:40 +01:00
saveShutdown methode
This commit is contained in:
parent
fcbc24fbf5
commit
8c3d55dec1
1 changed files with 13 additions and 1 deletions
14
manager.js
14
manager.js
|
@ -66,6 +66,18 @@ const manager = function(process){
|
|||
mayShutdown();
|
||||
});
|
||||
};
|
||||
|
||||
t.saveShutdown = function(){
|
||||
return new Promise((res,rej)=>{
|
||||
t.shutdown().then(()=>{
|
||||
setTimeout(function() { //some save time
|
||||
process.exit();
|
||||
}, 1000);
|
||||
}).catch(()=>{
|
||||
setTimeout(function() { //shutdown on error with more save time
|
||||
process.exit();
|
||||
}, 10000);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
export default manager;
|
||||
|
|
Loading…
Reference in a new issue