increase maxListeners

This commit is contained in:
Simon Knott 2024-10-04 14:05:15 +02:00
parent 895be9f8de
commit 3c57a78f63
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -492,9 +492,10 @@ export abstract class APIRequestContext extends SdkObject {
tcpConnectionAt = happyEyeBallsTimings.tcpConnectionAt; tcpConnectionAt = happyEyeBallsTimings.tcpConnectionAt;
// non-happy-eyeballs sockets // non-happy-eyeballs sockets
socket.on('lookup', () => { dnsLookupAt = monotonicTime(); }); socket.setMaxListeners(100); // default is 10. there might be more than 10 requests to the same server in parallel, and they all use the same socket
socket.on('connect', () => { tcpConnectionAt = monotonicTime(); }); socket.once('lookup', () => { dnsLookupAt = monotonicTime(); });
socket.on('secureConnect', () => { socket.once('connect', () => { tcpConnectionAt = monotonicTime(); });
socket.once('secureConnect', () => {
tlsHandshakeAt = monotonicTime(); tlsHandshakeAt = monotonicTime();
if (socket instanceof TLSSocket) { if (socket instanceof TLSSocket) {