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

Switch to beforeExit from exit event on process #606

Closed
humphd opened this issue Jan 26, 2020 · 3 comments · Fixed by #1186
Closed

Switch to beforeExit from exit event on process #606

humphd opened this issue Jan 26, 2020 · 3 comments · Fixed by #1186
Assignees
Labels
5 min fix Fixable in 5 minutes or less good first issue Good for newcomers type: bug Something isn't working

Comments

@humphd
Copy link
Contributor

humphd commented Jan 26, 2020

Our code to handle the exit event should probably be using beforeExit, since it looks like you can't run asynchronous code in the exit handler but can in beforeExit:

diff --git a/src/backend/index.js b/src/backend/index.js
index c8d2591..7835fdf 100644
--- a/src/backend/index.js
+++ b/src/backend/index.js
@@ -12,7 +12,7 @@ require('./web/server');
 /**
  * Shutting Down Logic for most Server Shutdown Cases
  */
-process.on('exit', shutdown('exit'));
+process.on('beforeExit', shutdown('beforeExit'));
 process.on('SIGTERM', shutdown('SIGTERM'));
 process.on('SIGINT', shutdown('SIGINT'));
 process.on('SIGQUIT', shutdown('SIGQUIT'));
@humphd humphd added type: bug Something isn't working good first issue Good for newcomers 5 min fix Fixable in 5 minutes or less labels Jan 26, 2020
@jossiey
Copy link
Contributor

jossiey commented Oct 6, 2020

What else I can do for this issue? Looks like you have fixed it.

@c3ho
Copy link
Contributor

c3ho commented Oct 6, 2020

@jossiey it is not fixed, feel free to submit a PR for it
image

@jossiey
Copy link
Contributor

jossiey commented Oct 6, 2020

Thanks. I will handle with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 min fix Fixable in 5 minutes or less good first issue Good for newcomers type: bug Something isn't working
Projects
None yet
3 participants