Skip to content

Commit

Permalink
fix recover canary after failure
Browse files Browse the repository at this point in the history
  • Loading branch information
massimocandela committed Feb 2, 2022
1 parent 98276a4 commit 12b8342
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/connectors/connectorRIS.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ export default class ConnectorRIS extends Connector {
instance: this.instanceId
}
});

if (this._shouldCanaryMonitoringStart()) { // The canary feature may impact performance if you are planning to get all the possible updates of RIS
this._startCanaryInterval = setInterval(this._startCanary, 60000);
}
};

_shouldCanaryMonitoringStart = () => {
Expand Down Expand Up @@ -283,7 +279,6 @@ export default class ConnectorRIS extends Connector {
}))
.then(() => {
this._checkCanary();
clearInterval(this._startCanaryInterval);
})
.catch(() => {
this.logger.log({
Expand Down Expand Up @@ -355,6 +350,12 @@ export default class ConnectorRIS extends Connector {
return (this.params.carefulSubscription
? Promise.all([this._subscribeToPrefixes(input), this._subscribeToASns(input)])
: this._subscribeToAll(input))
.then(() => {
if (this._shouldCanaryMonitoringStart()) {
this._startCanary();
}
}
)
.then(() => {
this.onInputChange(input);

Expand Down

0 comments on commit 12b8342

Please sign in to comment.