Skip to content

Commit

Permalink
refactor: min 3, reuse Env getNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jan 29, 2021
1 parent 557bdb8 commit 9463b1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { URL } from 'url';
import { Duration, maxBy, merge } from '@salesforce/kit';
import { Duration, maxBy, merge, Env } from '@salesforce/kit';
import { asString, ensure, getNumber, isString, JsonCollection, JsonMap, Optional } from '@salesforce/ts-types';
import {
Connection as JSForceConnection,
Expand Down Expand Up @@ -39,7 +39,7 @@ export const SFDX_HTTP_HEADERS = {
};

export const DNS_ERROR_NAME = 'Domain Not Found';
const DNS_TIMEOUT = parseInt(process.env.SFDX_DNS_TIMEOUT ?? '3', 10) || 3;
const DNS_TIMEOUT = Math.min(3, new Env().getNumber('SFDX_DNS_TIMEOUT') || 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

0 comments on commit 9463b1b

Please sign in to comment.