1
0
mirror of https://github.com/nttgin/BGPalerter.git synced 2024-05-19 06:50:08 +00:00

log when a vrp file is marked as stale

This commit is contained in:
Massimo Candela
2023-02-22 14:45:47 +01:00
parent f1276ad640
commit 250027f748

View File

@@ -300,7 +300,23 @@ export default class RpkiUtils {
if (!!this.params.preCacheROAs) {
const digest = md5(JSON.stringify(this.getVRPs()));
if (this.oldDigest) {
this.status.stale = this.oldDigest === digest;
const stale = this.oldDigest === digest;
if (this.status.stale !== stale) {
if (stale) {
this.logger.log({
level: 'error',
message: "The VRP file is stale"
});
} else {
this.logger.log({
level: 'info',
message: "The VRP file is back to normal"
});
}
}
this.status.stale = stale;
}
this.oldDigest = digest;