Skip to content

Commit

Permalink
Merge pull request trufflesuite#135 from trufflesuite/force-exit
Browse files Browse the repository at this point in the history
Close open handlers on exit
  • Loading branch information
cgewecke authored May 6, 2018
2 parents f014eea + b090eb9 commit dd86a0f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/truffle-core/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@ 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 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 (typeof handle.close === 'function'){
handle.close();
}
})
});

0 comments on commit dd86a0f

Please sign in to comment.