[GH-ISSUE #89] Proper way to shut down on SIGINT #58

Closed
opened 2026-05-23 08:28:36 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @advplyr on GitHub (Mar 27, 2022).
Original GitHub issue: https://github.com/appy-one/acebase/issues/89

Just trying this out and when CTRL+C to exit out of a node express server acebase is catching the SIGINT but not calling process.exit().

This is resulting in the express server remaining open. I noticed the process.exit() function was commented out a while back, probably for good reason but if left in it would properly exit in my case.

9c72e433ee/src/ts/ipc/index.ts (L122-L126)

I'm on Windows 10, Node v16. I'm not sure if I catch the SIGINT myself and process.exit if that will leave anything open in acebase.

Originally created by @advplyr on GitHub (Mar 27, 2022). Original GitHub issue: https://github.com/appy-one/acebase/issues/89 Just trying this out and when CTRL+C to exit out of a node express server acebase is catching the SIGINT but not calling process.exit(). This is resulting in the express server remaining open. I noticed the process.exit() function was commented out a while back, probably for good reason but if left in it would properly exit in my case. https://github.com/appy-one/acebase/blob/9c72e433eec9a9d44777e77c23cb9f2185c7b9e7/src/ts/ipc/index.ts#L122-L126 I'm on Windows 10, Node v16. I'm not sure if I catch the SIGINT myself and process.exit if that will leave anything open in acebase.
Author
Owner

@advplyr commented on GitHub (Mar 27, 2022):

I have a fine solution now by registering process.on('SIGINT') after instantiating AceBase and calling process.exit myself.

Now I understand why this is better then AceBase calling process.exit because it allows me to clean up what I need to before exiting. It looked like the close() method wasn't implemented yet when I skimmed the code, but this solution works for me anyway.

<!-- gh-comment-id:1079958458 --> @advplyr commented on GitHub (Mar 27, 2022): I have a fine solution now by registering process.on('SIGINT') after instantiating AceBase and calling process.exit myself. Now I understand why this is better then AceBase calling process.exit because it allows me to clean up what I need to before exiting. It looked like the close() method wasn't implemented yet when I skimmed the code, but this solution works for me anyway.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase#58
No description provided.