()
| 59 | * Exported for testing only. |
| 60 | */ |
| 61 | export function clearAgentCache(): void { |
| 62 | for (const agent of cachedAgents.values()) { |
| 63 | if (typeof agent.close === 'function') { |
| 64 | agent.close(); |
| 65 | } |
| 66 | } |
| 67 | cachedAgents.clear(); |
| 68 | for (const agent of cachedProxyAgents.values()) { |
| 69 | if (typeof agent.close === 'function') { |
| 70 | agent.close(); |
| 71 | } |
| 72 | } |
| 73 | cachedProxyAgents.clear(); |
| 74 | } |
| 75 | |
| 76 | function getOrCreateAgent(tlsOptions: ConnectionOptions): Dispatcher { |
| 77 | const concurrency = getConnectionPoolSize(); |
no test coverage detected
searching dependent graphs…