Skip to content

Commit 22b0dba

Browse files
committed
Update keepAlive todo
1 parent 1112ba5 commit 22b0dba

File tree

1 file changed

+3
-2
lines changed
  • packages/node/src/transports

1 file changed

+3
-2
lines changed

packages/node/src/transports/new.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ export function makeNodeTransport(options: NodeTransportOptions): NewTransport {
4646

4747
const nativeHttpModule = isHttps ? https : http;
4848

49+
// TODO(v7): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node
50+
// versions(>= 8) as they had memory leaks when using it: #2555
4951
const agent = proxy
5052
? (new (require('https-proxy-agent'))(proxy) as http.Agent)
51-
: // TODO(v7): Set keepAlive to true. Older versions of node had memory leaks when using it: #2555
52-
new nativeHttpModule.Agent({ keepAlive: false, maxSockets: 30, timeout: 2000 });
53+
: new nativeHttpModule.Agent({ keepAlive: false, maxSockets: 30, timeout: 2000 });
5354

5455
const requestExecutor = createRequestExecutor(options, options.httpModule ?? nativeHttpModule, agent);
5556
return createTransport({ bufferSize: options.bufferSize }, requestExecutor);

0 commit comments

Comments
 (0)