Skip to content

Commit f79735d

Browse files
committed
Revert "destroy agents"
This reverts commit 337541f.
1 parent 8054167 commit f79735d

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

packages/@aws-cdk/toolkit-lib/lib/api/aws-auth/awscli-compatible.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -270,28 +270,10 @@ export interface CredentialChainOptions {
270270
}
271271

272272
export function sdkRequestHandler(agent?: Agent): RequestHandlerSettings {
273-
const destroyAgents = (config: RequestHandlerSettings) => {
274-
try {
275-
config.httpAgent?.destroy();
276-
} catch (_) {
277-
}
278-
try {
279-
config.httpsAgent?.destroy();
280-
} catch (_) {
281-
}
282-
};
283-
284-
const result = {
273+
return {
285274
connectionTimeout: DEFAULT_CONNECTION_TIMEOUT,
286275
requestTimeout: DEFAULT_TIMEOUT,
287276
httpsAgent: agent,
288277
httpAgent: agent,
289278
};
290-
291-
process.on('beforeExit', () => destroyAgents(result));
292-
process.on('SIGINT', () => {
293-
destroyAgents(result); process.exit();
294-
});
295-
296-
return result;
297279
}

0 commit comments

Comments
 (0)