Skip to content

Commit

Permalink
hotfix vrps file reloading memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
massimocandela committed Jul 20, 2020
1 parent 78f0088 commit 9bf2227
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"nodemailer": "^6.4.10",
"path": "^0.12.7",
"restify": "^8.5.1",
"rpki-validator": "^2.1.5",
"rpki-validator": "^2.1.6",
"semver": "^7.3.2",
"syslog-client": "^1.1.1",
"ws": "^7.3.1",
Expand Down
11 changes: 8 additions & 3 deletions src/monitors/monitorRPKI.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,21 @@ export default class MonitorRPKI extends Monitor {
clearInterval(this.validationTimer); // Stop validation cycle
}

if (this.rpki) {
this.rpki.destroy();
}

this.rpki = new rpki({
connector: "external",
clientId: env.clientId,
vrps
clientId: env.clientId
});

this.rpki.setVRPs(vrps);

this.rpki
.preCache()
.then(() => {
this.validationTimer = setInterval(this.validateBatch, 100); // If already cached, we can validate more often
this.validationTimer = setInterval(this.validateBatch, 50); // If already cached, we can validate more often
})
.catch(() => {
this.logger.log({
Expand Down

0 comments on commit 9bf2227

Please sign in to comment.