Skip to content

Commit

Permalink
feat: adjustable DNS timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jan 22, 2021
1 parent f04e66e commit 9db7b66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const SFDX_HTTP_HEADERS = {
};

export const DNS_ERROR_NAME = 'Domain Not Found';
const DNS_TIMEOUT = process.env.SFDX_DNS_TIMEOUT ? parseInt(process.env.SFDX_DNS_TIMEOUT, 10) : 3;

// 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
Expand Down Expand Up @@ -218,8 +219,8 @@ export class Connection extends JSForceConnection {
}
const resolver = await MyDomainResolver.create({
url: new URL(this.options.connectionOptions.instanceUrl),
timeout: Duration.seconds(10),
frequency: Duration.seconds(10),
timeout: Duration.seconds(DNS_TIMEOUT),
frequency: Duration.seconds(DNS_TIMEOUT),
});
try {
await resolver.resolve();
Expand Down

0 comments on commit 9db7b66

Please sign in to comment.