Skip to content

Commit

Permalink
set defaults for arin fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
massimocandela committed Jun 11, 2023
1 parent 26f52b3 commit 488ae0b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/connectors/connectorARINrir.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ export default class ConnectorARIN extends Connector {
this.daysWhoisSuballocationsCache = this.params.daysWhoisSuballocationsCache || 4;
this.skipSuballocations = !!this.params.skipSuballocations;

if (this.daysWhoisSuballocationsCache < 4) {
throw new Error("Sub allocations in ARIN cannot be fetched more than once every 4 days.");
if (this.daysWhoisSuballocationsCache < 7) {
console.log("Sub allocations in ARIN cannot be fetched more than once every 7 days. Using 7 days.");
this.daysWhoisSuballocationsCache = 7;
}

if (this.daysWhoisCache < 3) {
console.log("NetRanges in ARIN cannot be fetched more than once every 3 days. Using 3 days.");
this.daysWhoisCache = 3;
}

this.httpAgent = new http.Agent({ keepAlive: true });
Expand Down

0 comments on commit 488ae0b

Please sign in to comment.