Skip to content

Commit fff977e

Browse files
committed
Remove unnecessary that/this conversion
1 parent 8d5af3a commit fff977e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/configproxy.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ class ConfigurableProxy extends EventEmitter {
361361
deleteRoutes(req, res, path) {
362362
// DELETE removes an existing route
363363

364-
var that = this;
365364
return this._routes.get(path).then((result) => {
366365
var p, code;
367366
if (result) {
@@ -374,7 +373,7 @@ class ConfigurableProxy extends EventEmitter {
374373
return p.then(() => {
375374
res.writeHead(code);
376375
res.end();
377-
that.metrics.apiRouteDeleteCount.inc();
376+
this.metrics.apiRouteDeleteCount.inc();
378377
});
379378
});
380379
}
@@ -629,10 +628,9 @@ class ConfigurableProxy extends EventEmitter {
629628
handleApiRequest(req, res) {
630629
// Handle a request to the REST API
631630
if (res) {
632-
var that = this;
633631
res.on("finish", () => {
634-
that.metrics.requestsApiCount.labels(res.statusCode).inc();
635-
that.logResponse(req, res);
632+
this.metrics.requestsApiCount.labels(res.statusCode).inc();
633+
this.logResponse(req, res);
636634
});
637635
}
638636
var args = [req, res];

0 commit comments

Comments
 (0)