@io-orkes/conductor-javascript 1.2.0-rc.8 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -38,6 +38,7 @@ declare class DnsCacheResolver {
38
38
  });
39
39
  resolve(host: string): Promise<string | undefined>;
40
40
  clearCache(): void;
41
+ removeCache(host: string): void;
41
42
  get cache(): Map<string, string>;
42
43
  }
43
44
 
package/dist/index.d.ts CHANGED
@@ -38,6 +38,7 @@ declare class DnsCacheResolver {
38
38
  });
39
39
  resolve(host: string): Promise<string | undefined>;
40
40
  clearCache(): void;
41
+ removeCache(host: string): void;
41
42
  get cache(): Map<string, string>;
42
43
  }
43
44
 
package/dist/index.js CHANGED
@@ -3509,6 +3509,9 @@ var DnsCacheResolver = class {
3509
3509
  clearCache() {
3510
3510
  this._cache.clear();
3511
3511
  }
3512
+ removeCache(host) {
3513
+ this._cache.delete(host);
3514
+ }
3512
3515
  get cache() {
3513
3516
  return this._cache;
3514
3517
  }
@@ -3555,8 +3558,15 @@ var fetchCatchDns = (fetch3, {
3555
3558
  ...options,
3556
3559
  headers: headersOverride
3557
3560
  };
3558
- const res = await fetch3(target.toString(), optionsOverride);
3559
- return res;
3561
+ try {
3562
+ const res = await fetch3(target.toString(), optionsOverride);
3563
+ return res;
3564
+ } catch (e) {
3565
+ if (e && e?.code === "ETIMEDOUT") {
3566
+ dnsCache.removeCache(hostname);
3567
+ }
3568
+ throw e;
3569
+ }
3560
3570
  };
3561
3571
  return fetchWithDns;
3562
3572
  };