| 321 | // addresses" and blackhole the hostname for the rest of the window; the |
| 322 | // uncached code re-resolved every request and never could. |
| 323 | const bounded: GuardResolver = (hostname) => |
| 324 | Effect.timeoutOrElse(resolve(hostname), { |
| 325 | duration: Duration.millis( |
| 326 | options.dnsResolutionTimeoutMillis ?? DNS_RESOLUTION_TIMEOUT_MILLIS, |
| 327 | ), |
| 328 | orElse: () => Effect.fail(new HostedHostnameResolutionFailed({ hostname, empty: false })), |
| 329 | }); |
| 330 | const cache = Effect.runSync( |
| 331 | Cache.makeWith(bounded, { |
| 332 | capacity: options.dnsCacheCapacity ?? DNS_CACHE_CAPACITY, |