Skip to content

Commit

Permalink
Revert socket counter
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlika committed Jun 23, 2024
1 parent 8d9fa21 commit f970f41
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/uws-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export class UWebSocketsTracker {
compression: this.settings.websockets.compression,
maxPayloadLength: this.settings.websockets.maxPayloadLength,
idleTimeout: this.settings.websockets.idleTimeout,
open: this.onOpen,
upgrade: this.onUpgrade,
drain: (ws: WebSocket<SocketContext>) => {
if (debugWebSocketsEnabled) {
Expand All @@ -195,6 +196,10 @@ export class UWebSocketsTracker {
});
}

private readonly onOpen = (): void => {
this.webSocketsCount++;
};

private readonly onUpgrade = (
response: HttpResponse,
request: HttpRequest,
Expand Down Expand Up @@ -271,8 +276,6 @@ export class UWebSocketsTracker {
);
}

this.webSocketsCount++;

response.upgrade<Omit<SocketContext, "ws">>(
{
sendMessage,
Expand Down

0 comments on commit f970f41

Please sign in to comment.