Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Close open handlers on exit #135

Merged
merged 4 commits into from
May 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions 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();
}
})
});