From c1c2331d2155a463f90d31b0866c38e736c30594 Mon Sep 17 00:00:00 2001 From: DY6229 Date: Thu, 24 Jan 2019 16:57:08 +0200 Subject: [PATCH] fix bug in get connections (#21) * fix bug in get connections --- package-lock.json | 9 +++++---- src/express-middleware.js | 2 +- src/koa-middleware.js | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8502be3..5d26d1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -633,7 +633,7 @@ }, "any-promise": { "version": "1.3.0", - "resolved": "http://npm.zooz.co:8083/any-promise/-/any-promise-1.3.0.tgz", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", "dev": true }, @@ -1353,7 +1353,7 @@ }, "deep-equal": { "version": "1.0.1", - "resolved": "http://npm.zooz.co:8083/deep-equal/-/deep-equal-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", "dev": true }, @@ -2899,8 +2899,9 @@ }, "lodash.get": { "version": "4.4.2", - "resolved": "http://npm.zooz.co:8083/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true }, "log-driver": { "version": "1.2.7", diff --git a/src/express-middleware.js b/src/express-middleware.js index 8d1a361..86aad69 100644 --- a/src/express-middleware.js +++ b/src/express-middleware.js @@ -14,7 +14,7 @@ class ExpressMiddleware { help: 'Number of open connections to the Express.js server' }); if (this.setupOptions.server) { - setInterval(this._getConnections, timeout).unref(); + setInterval(this._getConnections.bind(this), timeout).unref(); } } _getConnections() { diff --git a/src/koa-middleware.js b/src/koa-middleware.js index 9782632..9a76b80 100644 --- a/src/koa-middleware.js +++ b/src/koa-middleware.js @@ -16,7 +16,7 @@ class KoaMiddleware { help: 'Number of open connections to the Koa.js server' }); if (this.setupOptions.server) { - setInterval(this._getConnections, timeout).unref(); + setInterval(this._getConnections.bind(this), timeout).unref(); } } _getConnections() {