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

Gracefully quit on Ctrl+C #1477

Merged
merged 1 commit into from Aug 31, 2017
Merged

Gracefully quit on Ctrl+C #1477

merged 1 commit into from Aug 31, 2017

Conversation

xPaw
Copy link
Member

@xPaw xPaw commented Aug 30, 2017

Fixes #268

@xPaw xPaw added the Type: Feature Tickets that describe a desired feature or PRs that add them to the project. label Aug 30, 2017
@xPaw xPaw added this to the 2.5.0 milestone Aug 30, 2017
Copy link
Member

@astorije astorije left a comment

Choose a reason for hiding this comment

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

Good stuff! One minor comment, feel free to address or not.

}

// Forcefully exit after 3 seconds
suicideTimeout = setTimeout(() => process.exit(1), 3000);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe another log.info in there, like "Something went wrong, force-quitting now"? Also, could do 5000 just in case, but whatever.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it's necessary to add a message.

@astorije
Copy link
Member

@xPaw feel free to address comment or not, then to merge or let @YaManicKill review first. I'm good either way.

Copy link
Member

@AlMcKinlay AlMcKinlay left a comment

Choose a reason for hiding this comment

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

¯_(ツ)_/¯ looks good

@@ -499,7 +499,10 @@ Client.prototype.quit = function() {
const socket = sockets.connected[user];

if (socket) {
socket.emit("sign-out");
if (signOut) {
Copy link
Member

Choose a reason for hiding this comment

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

This feels like an unrelated fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not, we don't want to sign out users on server close.

Copy link
Member

Choose a reason for hiding this comment

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

Oh woops, I missed that we were already sending sign-out. Sounds good.

@xPaw xPaw merged commit 271948b into master Aug 31, 2017
@xPaw xPaw deleted the xpaw/graceful-quit branch August 31, 2017 19:12
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
@astorije astorije changed the title Gracefully quit on Ctrl+C Gracefully quit on <kbd>Ctrl</kbd>+<kbd>C</kbd> Sep 29, 2017
@astorije astorije changed the title Gracefully quit on <kbd>Ctrl</kbd>+<kbd>C</kbd> Gracefully quit on Ctrl+C Sep 29, 2017
@xPaw xPaw removed their assignment Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Tickets that describe a desired feature or PRs that add them to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants