Skip to content

Commit

Permalink
[rush-lib] Fix issue with MaxListenersExceeded while using the HTTP…
Browse files Browse the repository at this point in the history
… build cache plugin (#5073)

* Remove the socket error handler for WebClient

* Rush change

* Remove unused import

---------

Co-authored-by: Daniel <[email protected]>
  • Loading branch information
D4N14L and D4N14L authored Jan 9, 2025
1 parent dcfc223 commit e5560f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Fix an issue where MaxListenersExceeded would get thrown when using the HTTP build cache plugin",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
6 changes: 0 additions & 6 deletions libraries/rush-lib/src/utilities/WebClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as process from 'process';
import type * as http from 'http';
import { request as httpRequest, type IncomingMessage } from 'node:http';
import { request as httpsRequest, type RequestOptions } from 'node:https';
import type { Socket } from 'node:net';
import { Import, LegacyAdapters } from '@rushstack/node-core-library';

const createHttpsProxyAgent: typeof import('https-proxy-agent') = Import.lazy('https-proxy-agent', require);
Expand Down Expand Up @@ -199,11 +198,6 @@ const makeRequestAsync: FetchFn = async (
resolve(result);
});
})
.on('socket', (socket: Socket) => {
socket.on('error', (error: Error) => {
reject(error);
});
})
.on('error', (error: Error) => {
reject(error);
})
Expand Down

0 comments on commit e5560f2

Please sign in to comment.