Skip to content

Commit

Permalink
add initial vrps check
Browse files Browse the repository at this point in the history
  • Loading branch information
massimocandela committed Feb 12, 2024
1 parent dc4f87a commit 7c0a79d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/monitors/monitorROAS.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ export default class MonitorROAS extends Monitor {

_enablePeriodicCheck = (condition, checkFunction, seconds) => {
if (condition) {
setInterval(() => {
this._skipIfStaleVrps(checkFunction);
}, global.EXTERNAL_ROA_EXPIRATION_TEST || seconds * 1000);
if (!global.EXTERNAL_ROA_EXPIRATION_TEST) {
setTimeout(() => this._skipIfStaleVrps(checkFunction), 30 * 1000); // Initial run
}
setInterval(() => this._skipIfStaleVrps(checkFunction), global.EXTERNAL_ROA_EXPIRATION_TEST || seconds * 1000); // Periodic run
}
}

Expand Down

0 comments on commit 7c0a79d

Please sign in to comment.