Desktop: Add ping checks for desktop #3062
Closed
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.
Electron will periodically send pings to Calypso to make sure the server is still running. If we fail to get a response, Electron can detect that and handle accordingly.
In the same vein, Electron may die (e.g.
kill -9
) but Calypso can continue running, which is not great.When a ping comes in (where the value of the ping is the frequency in ms for the pings), we ping back with that same frequency. We also start a killswitch that will exit the process if we don't get a ping back in a certain amount of time. This way, Calypso can kill itself if its parent process disappears.
See https://github.com/Automattic/wp-desktop/issues/51 for testing instructions.