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

cacheable - unref check interval to allow node exit #919

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

mothershipper
Copy link
Contributor

When a check interval is passed to the cache, cachable starts an interval that prevents node from exiting unless it gets cleared. There is a public method to stop the interval, but it's flagged as internal use only.

Given this, I've opted to unref the interval to allow the node process to exit cleanly.

The other alternative would be to add a public close/disconnect API method -- the Keyv interface seems to account for this case -- however, it does make the API more cumbersome for the end-user.

When a check interval is passed to the cache, cachable starts an
interval that prevents node from exiting unless it gets cleared. There
is a public method to stop the interval, but it's flagged as internal
use only.

Given this, I've opted to unref the interval to allow the node process
to exit cleanly.

The other alternative would be to add a public close/disconnect API
method -- the Keyv interface seems to account for this case -- however,
it does make the API more cumbersome for the end-user.
@jaredwray jaredwray changed the title cachable - unref check interval to allow node exit cacheable - unref check interval to allow node exit Dec 3, 2024
@jaredwray
Copy link
Owner

@mothershipper - thanks so much and really appreciate it. This should work for most cases.

@jaredwray jaredwray merged commit 18c4d47 into jaredwray:main Dec 3, 2024
3 checks passed
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.

2 participants