MCPcopy
hub / github.com/promptfoo/promptfoo / clearAgentCache

Function clearAgentCache

src/util/fetch/index.ts:61–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59 * Exported for testing only.
60 */
61export 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
76function getOrCreateAgent(tlsOptions: ConnectionOptions): Dispatcher {
77 const concurrency = getConnectionPoolSize();

Callers 3

fetch.test.tsFile · 0.90
shutdownGracefullyFunction · 0.90

Calls 3

valuesMethod · 0.80
closeMethod · 0.65
clearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…