Comparing version 9.1.0 to 9.2.0
@@ -7,2 +7,7 @@ # Change Log | ||
## [9.2.0](https://github.com/AndrewBarba/apns2/releases/tag/9.2.0) | ||
1. Allow disabling pingInterval | ||
2. Fix issue with missing ping callback | ||
## [9.1.0](https://github.com/AndrewBarba/apns2/releases/tag/9.1.0) | ||
@@ -9,0 +14,0 @@ |
@@ -138,4 +138,6 @@ const http2 = require('http2') | ||
client.on('goaway', () => this._closeAndDestroy(client)) | ||
if (this._pingIntervalMs) { | ||
this._createPingInterval(client) | ||
} | ||
this._client = client | ||
this._pingInterval = setInterval(() => client.ping(), this._pingIntervalMs).unref() | ||
return client | ||
@@ -145,2 +147,15 @@ } | ||
/** | ||
* Sends a ping on an interval | ||
* | ||
* @private | ||
* @method _createPingInterval | ||
*/ | ||
_createPingInterval(client) { | ||
const sendPing = () => { | ||
client.ping(null, () => {}) | ||
} | ||
this._pingInterval = setInterval(sendPing, this._pingIntervalMs).unref() | ||
} | ||
/** | ||
* Closes and destorys the existing client. A new client will be created on next request | ||
@@ -147,0 +162,0 @@ * |
{ | ||
"name": "apns2", | ||
"version": "9.1.0", | ||
"version": "9.2.0", | ||
"description": "Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens.", | ||
@@ -5,0 +5,0 @@ "author": "Andrew Barba <barba@hey.com>", |
@@ -36,3 +36,4 @@ const should = require('should') | ||
signingKey: process.env.APNS_SIGNING_KEY, | ||
defaultTopic: `com.tablelist.Tablelist` | ||
defaultTopic: `com.tablelist.Tablelist`, | ||
pingInterval: 100 | ||
}) | ||
@@ -39,0 +40,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33027
818