From 4ba7a63ad5019c33123773789af6c7c58e4c6eb3 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Tue, 16 Feb 2021 10:41:24 -0700 Subject: [PATCH] fix: revert dns polling timeout to 30 and frequency to 10 --- src/connection.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/connection.ts b/src/connection.ts index 94815076eb..01cdd330e2 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -39,7 +39,10 @@ export const SFDX_HTTP_HEADERS = { }; export const DNS_ERROR_NAME = 'Domain Not Found'; -const DNS_TIMEOUT = Math.max(3, new Env().getNumber('SFDX_DNS_TIMEOUT') || 3); +// Timeout for DNS lookup polling defaults to 30 seconds and should always be at least 3 seconds +const DNS_TIMEOUT = Math.max(3, new Env().getNumber('SFDX_DNS_TIMEOUT', 30) as number); +// Retry frequency for DNS lookup polling should be at least 10 seconds +const DNS_RETRY_FREQ = Math.max(10, new Env().getNumber('SFDX_DNS_RETRY_FREQUENCY', 10) as number); // This interface is so we can add the autoFetchQuery method to both the Connection // and Tooling classes and get nice typing info for it within editors. JSForce is @@ -220,7 +223,7 @@ export class Connection extends JSForceConnection { const resolver = await MyDomainResolver.create({ url: new URL(this.options.connectionOptions.instanceUrl), timeout: Duration.seconds(DNS_TIMEOUT), - frequency: Duration.seconds(DNS_TIMEOUT), + frequency: Duration.seconds(DNS_RETRY_FREQ), }); try { await resolver.resolve();