Skip to content

Commit

Permalink
Fix code references in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Jul 22, 2023
1 parent 7a1e435 commit 49583c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/beacon-node/src/api/rest/activeSockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export type SocketMetrics = {
const GRACEFUL_TERMINATION_TIMEOUT = 1_000;

/**
* From https://github.com/nodejs/node/blob/57bd715d527aba8dae56b975056961b0e429e91e/lib/_http_client.js#L363-L413
* But exposes the count of sockets, and waits for connections to drain until timeout
* From https://github.com/gajus/http-terminator/blob/aabca4751552e983f8a59ba896b7fb58ce3b4087/src/factories/createInternalHttpTerminator.ts#L24-L61
* But only handles HTTP sockets, exposes the count of sockets as metrics
*/
export class HttpActiveSocketsTracker {
private sockets = new Set<Socket>();
Expand Down Expand Up @@ -50,7 +50,7 @@ export class HttpActiveSocketsTracker {
* Wait for all connections to drain, forcefully terminate any open connections after timeout
*
* From https://github.com/gajus/http-terminator/blob/aabca4751552e983f8a59ba896b7fb58ce3b4087/src/factories/createInternalHttpTerminator.ts#L78-L165
* But only handles HTTP sockets and does not close server, immediately terminates api.eventstream connections
* But only handles HTTP sockets and does not close server, immediately terminates eventstream API connections
*/
async terminate(): Promise<void> {
if (this.terminated) return;
Expand Down Expand Up @@ -78,7 +78,7 @@ export class HttpActiveSocketsTracker {
// Immediately destroy sockets without an attached HTTP request
this.destroySocket(socket);
} else if (serverResponse.getHeader("Content-Type") === "text/event-stream") {
// api.eventstream will never stop and must be forcefully terminated
// eventstream API will never stop and must be forcefully terminated
this.destroySocket(socket);
} else if (!serverResponse.headersSent) {
// Inform existing keep-alive connections that they will be closed after the current response
Expand Down

0 comments on commit 49583c1

Please sign in to comment.