summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-03-27 12:17:23 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-03-28 11:03:31 -0400
commitb8fd9d0bc04656d30628e5f7a3c7c74632014154 (patch)
tree0ea358ee9a36a9f83d6cee1c144b11658e7f9afb /packages/backend/src
parentlimit the number of note subscriptions per connection (diff)
downloadsharkey-b8fd9d0bc04656d30628e5f7a3c7c74632014154.tar.gz
sharkey-b8fd9d0bc04656d30628e5f7a3c7c74632014154.tar.bz2
sharkey-b8fd9d0bc04656d30628e5f7a3c7c74632014154.zip
clear subscriptions when connection closes
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/server/api/stream/Connection.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/backend/src/server/api/stream/Connection.ts b/packages/backend/src/server/api/stream/Connection.ts
index 36e5769216..691ce54feb 100644
--- a/packages/backend/src/server/api/stream/Connection.ts
+++ b/packages/backend/src/server/api/stream/Connection.ts
@@ -373,5 +373,12 @@ export default class Connection {
for (const c of this.channels.filter(c => c.dispose)) {
if (c.dispose) c.dispose();
}
+ for (const k of this.subscribingNotes.keys()) {
+ this.subscriber.off(`noteStream:${k}`, this.onNoteStreamMessage);
+ }
+
+ this.fetchIntervalId = null;
+ this.channels = [];
+ this.subscribingNotes.clear();
}
}