Skip to content

Commit

Permalink
Remove unnecessary that/this conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaniwaki committed May 25, 2021
1 parent 8d5af3a commit fff977e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/configproxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ class ConfigurableProxy extends EventEmitter {
deleteRoutes(req, res, path) {
// DELETE removes an existing route

var that = this;
return this._routes.get(path).then((result) => {
var p, code;
if (result) {
Expand All @@ -374,7 +373,7 @@ class ConfigurableProxy extends EventEmitter {
return p.then(() => {
res.writeHead(code);
res.end();
that.metrics.apiRouteDeleteCount.inc();
this.metrics.apiRouteDeleteCount.inc();
});
});
}
Expand Down Expand Up @@ -629,10 +628,9 @@ class ConfigurableProxy extends EventEmitter {
handleApiRequest(req, res) {
// Handle a request to the REST API
if (res) {
var that = this;
res.on("finish", () => {
that.metrics.requestsApiCount.labels(res.statusCode).inc();
that.logResponse(req, res);
this.metrics.requestsApiCount.labels(res.statusCode).inc();
this.logResponse(req, res);
});
}
var args = [req, res];
Expand Down

0 comments on commit fff977e

Please sign in to comment.