Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Ctrl-C Behavior #140

Merged
merged 8 commits into from
Aug 24, 2015
Merged

Better Ctrl-C Behavior #140

merged 8 commits into from
Aug 24, 2015

Conversation

pnagurny
Copy link
Contributor

No description provided.

@pnagurny pnagurny changed the title WIP Better Ctrl-C Behavior Better Ctrl-C Behavior Aug 24, 2015
@braydonf
Copy link
Contributor

After running $ node bin/start.js, ^C doesn't stop the node here.

@@ -26,3 +26,32 @@ daemon.on('error', function(err) {
daemon.on('open', function(status) {
log.info('status="%s"', status);
});

function exitHandler(options, err) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is reused. Should it be a part of the Node?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to have this in the bin scripts and not lib/ because other people using bitcore node in their own application may want to handle process signals differently. I'm up for having a util class in bin/ which can have the exit handler if we don't want to have the same code twice, or we can wait for your command line interface changes and deal with it then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we can put it as Node.prototype.defaultExitHandler.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can handle this in another PR.

@braydonf
Copy link
Contributor

With the changes in pnagurny#1 I'm getting a segment fault after shutdown. I've tracked it down to an issue with closing LevelDB in leveldown, and is likely related to Level/leveldown#157

Patrick Nagurny and others added 7 commits August 24, 2015 13:29
@braydonf
Copy link
Contributor

LGTM

braydonf pushed a commit that referenced this pull request Aug 24, 2015
@braydonf braydonf merged commit 4a50df9 into bitpay:master Aug 24, 2015
@braydonf
Copy link
Contributor

Excellent work on this, the shutdown behavior is much better now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants