summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/stream
diff options
context:
space:
mode:
authorAmelia Yukii <amelia.yukii@shourai.de>2024-08-18 17:28:09 +0000
committerAmelia Yukii <amelia.yukii@shourai.de>2024-08-18 17:28:09 +0000
commit2e2dcb6b8d191a3f9f35e9f7470a714d840268b4 (patch)
tree97892764b7e8bd9d7b7d4f34e9894b48ff60036a /packages/backend/src/server/api/stream
parentmerge: fix `offsetMode` in `MkPagination` - fixes #622 (!599) (diff)
parentmake the cap of `activeRateLimitRequests` match the rate limit (diff)
downloadsharkey-2e2dcb6b8d191a3f9f35e9f7470a714d840268b4.tar.gz
sharkey-2e2dcb6b8d191a3f9f35e9f7470a714d840268b4.tar.bz2
sharkey-2e2dcb6b8d191a3f9f35e9f7470a714d840268b4.zip
merge: make the cap of `activeRateLimitRequests` match the rate limit (!602)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/602 Approved-by: Julia Johannesen <julia@insertdomain.name> Approved-by: Amelia Yukii <amelia.yukii@shourai.de> Approved-by: Marie <2-Marie@users.noreply.activitypub.software>
Diffstat (limited to 'packages/backend/src/server/api/stream')
-rw-r--r--packages/backend/src/server/api/stream/Connection.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/backend/src/server/api/stream/Connection.ts b/packages/backend/src/server/api/stream/Connection.ts
index b71a99b89e..7ea92eb797 100644
--- a/packages/backend/src/server/api/stream/Connection.ts
+++ b/packages/backend/src/server/api/stream/Connection.ts
@@ -120,7 +120,9 @@ export default class Connection {
if (this.closingConnection) return;
if (this.rateLimiter) {
- if (this.activeRateLimitRequests <= 128) {
+ // this 4096 should match the `max` of the `rateLimiter`, see
+ // StreamingApiServerService
+ if (this.activeRateLimitRequests <= 4096) {
this.activeRateLimitRequests++;
const shouldRateLimit = await this.rateLimiter();
this.activeRateLimitRequests--;