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
198 stars 75 forks source link

[FIX] set retryCount after internet connection is back #6

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

Thanks !