Skip to content

Commit

Permalink
feat: dns lookup doesn't include port
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Nov 11, 2024
1 parent 81dcfb3 commit 1afcc89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/status/myDomainResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,24 @@ export class MyDomainResolver extends AsyncOptionalCreatable<MyDomainResolver.Op
const self: MyDomainResolver = this;
const pollingOptions: PollingClient.Options = {
async poll(): Promise<StatusResult> {
const { host } = self.options.url;
const { hostname } = self.options.url;
let dnsResult: { address: string };
try {
self.logger.debug(`Attempting to resolve url: ${host}`);
self.logger.debug(`Attempting to resolve url: ${hostname}`);
if (new SfdcUrl(self.options.url).isLocalUrl()) {
return {
completed: true,
payload: '127.0.0.1',
};
}
dnsResult = await promisify(lookup)(host);
self.logger.debug(`Successfully resolved host: ${host} result: ${JSON.stringify(dnsResult)}`);
dnsResult = await promisify(lookup)(hostname);
self.logger.debug(`Successfully resolved host: ${hostname} result: ${JSON.stringify(dnsResult)}`);
return {
completed: true,
payload: dnsResult.address,
};
} catch (e) {
self.logger.debug(`An error occurred trying to resolve: ${host}`);
self.logger.debug(`An error occurred trying to resolve: ${hostname}`);
self.logger.debug(`Error: ${(e as Error).message}`);
self.logger.debug('Re-trying dns lookup again....');
return {
Expand Down
2 changes: 1 addition & 1 deletion src/util/sfdcUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class SfdcUrl extends URL {
'.stm.salesforce.ms',
'.pc-rnd.force.com',
'.pc-rnd.salesforce.com',
'.wc.crm.dev', // workspaces container
'.crm.dev', // workspaces container
];
return (
this.origin.startsWith('https://gs1.') ||
Expand Down

2 comments on commit 1afcc89

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - ubuntu-latest

Benchmark suite Current: 1afcc89 Previous: 37e777e Ratio
Child logger creation 467852 ops/sec (±1.05%) 504547 ops/sec (±2.08%) 1.08
Logging a string on root logger 860220 ops/sec (±6.90%) 934392 ops/sec (±9.14%) 1.09
Logging an object on root logger 42097 ops/sec (±184.42%) 38163 ops/sec (±186.21%) 0.91
Logging an object with a message on root logger 434653 ops/sec (±5.06%) 438398 ops/sec (±10.90%) 1.01
Logging an object with a redacted prop on root logger 508619 ops/sec (±5.40%) 552159 ops/sec (±7.44%) 1.09
Logging a nested 3-level object on root logger 19512 ops/sec (±186.49%) 15689 ops/sec (±196.51%) 0.80

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - windows-latest

Benchmark suite Current: 1afcc89 Previous: 37e777e Ratio
Child logger creation 334160 ops/sec (±0.63%) 315537 ops/sec (±1.57%) 0.94
Logging a string on root logger 783790 ops/sec (±8.48%) 821464 ops/sec (±7.04%) 1.05
Logging an object on root logger 609843 ops/sec (±8.00%) 546299 ops/sec (±9.05%) 0.90
Logging an object with a message on root logger 4151 ops/sec (±213.90%) 6802 ops/sec (±204.57%) 1.64
Logging an object with a redacted prop on root logger 427278 ops/sec (±14.69%) 463387 ops/sec (±7.79%) 1.08
Logging a nested 3-level object on root logger 343296 ops/sec (±4.74%) 308778 ops/sec (±4.42%) 0.90

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.