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
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@xPaw feel free to address comment or not, then to merge or let @YaManicKill review first. I'm good either way. |
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Gracefully quit on Ctrl+C
Ctrl+C
Fixes #268