Skip to content

Commit

Permalink
Close the open
Browse files Browse the repository at this point in the history
  • Loading branch information
cgewecke committed May 5, 2018
1 parent eab7a6f commit b090eb9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/truffle-core/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ command.run(process.argv.slice(2), options, function(err) {
// Don't exit if no error; if something is keeping the process open,
// like `truffle console`, then let it.

// Clear any polling though - `provider-engine` in HDWallet
// and `web3 1.0 confirmations` both interval timers wide open.
const Timer = process.binding('timer_wrap').Timer;
// Clear any polling or open sockets - `provider-engine` in HDWallet
// and `web3 1.0 confirmations` both leave interval timers etc wide open.
const handles = process._getActiveHandles();
handles.forEach(handle => {
if (handle instanceof Timer){
if (typeof handle.close === 'function'){
handle.close();
}
})
Expand Down

0 comments on commit b090eb9

Please sign in to comment.