{{ message }}
fix(endpoint): destroy after shutdown to clear heartbeat interval#554
Open
martijndeh wants to merge 1 commit into
Open
fix(endpoint): destroy after shutdown to clear heartbeat interval#554martijndeh wants to merge 1 commit into
martijndeh wants to merge 1 commit into
Conversation
Member
|
@martijndeh Could you please make sure that the test coverage stays at 100%? Thanks! |
mtaweel
added a commit
to mtaweel/node-pushnotifications
that referenced
this pull request
Jan 22, 2019
Switch node-apn to `martijndeh/node-apn` which solves this issue -> node-apn/node-apn#554
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The heartbeat interval keeps the event loop alive. Originally, I just did an
.unref()on the interval to fix the issue, but the warnings in the docs made me implement the fix in another way.So now, after a shutdown, the endpoints get flagged as pending destroy. If the internal sockets closes and pending destroy is set, it finally calls the destroy clearing all heartbeat intervals.
Fixes #543.