Skip to content

Commit

Permalink
emit telemetry socket close after counter dec
Browse files Browse the repository at this point in the history
  • Loading branch information
mfornos committed Dec 12, 2024
1 parent 5c0b296 commit d1f9cac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/server/src/services/subscriptions/api/ws/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,15 @@ export default class WebsocketProtocol extends (EventEmitter as new () => Teleme
socket.once('close', async () => {
this.#clientsNum--

this.emit('telemetrySocketListener', request.ip, subscription, true)

const { id, agent, ephemeral } = subscription

try {
if (ephemeral) {
// TODO clean up pending matches
await this.#switchboard.unsubscribe(agent, id)
}

this.emit('telemetrySocketListener', request.ip, subscription, true)
} catch (error) {
this.#log.error(error)
} finally {
Expand Down

0 comments on commit d1f9cac

Please sign in to comment.