MatthieuLemoine / push-receiver

A library to subscribe to GCM/FCM and receive notifications within a node process.
https://medium.com/@MatthieuLemoine/my-journey-to-bring-web-push-support-to-node-and-electron-ce70eea1c0b0
MIT License
202 stars 80 forks source link

Fix retryCount after internet connection is back #5

Closed PedroKantar closed 6 years ago

PedroKantar commented 6 years ago

When the internet connection is down again after being lost one first time, the reseted retryCount value is now taken into account and the retry attempts (socket.connect()) are well delayed in a progressive way (1, 2, 3, 4, ... 15 seconds) The fix is based on a global value:

let retryCount = 0;         // retries count of opening socket attempts
MatthieuLemoine commented 6 years ago

Can you create a new branch from this repo master branch so that the PR only contains the new commit ?

PedroKantar commented 6 years ago

Ok, I transferred it to a new PR: #6 (based on a branch)