From 488ae0b554f855527bb2b6de162d84b7017cc3dc Mon Sep 17 00:00:00 2001 From: Massimo Candela Date: Sun, 11 Jun 2023 13:28:40 +0200 Subject: [PATCH] set defaults for arin fetching --- src/connectors/connectorARINrir.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/connectors/connectorARINrir.js b/src/connectors/connectorARINrir.js index 9d448e3..591b6f2 100644 --- a/src/connectors/connectorARINrir.js +++ b/src/connectors/connectorARINrir.js @@ -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 });