Skip to content
Snippets Groups Projects
Commit 2e2dcb6b authored by Amelia Yukii's avatar Amelia Yukii
Browse files

merge: make the cap of `activeRateLimitRequests` match the rate limit (!602)

View MR for information: !602



Approved-by: default avatarJulia Johannesen <julia@insertdomain.name>
Approved-by: default avatarAmelia Yukii <amelia.yukii@shourai.de>
Approved-by: default avatarMarie <2-Marie@users.noreply.activitypub.software>
parents d03c9f4b 77144b05
No related branches found
No related tags found
2 merge requests!620Bump version,!602make the cap of `activeRateLimitRequests` match the rate limit
Pipeline #1030 passed with stages
in 46 minutes and 12 seconds
......@@ -151,7 +151,7 @@ export class StreamingApiServerService {
return this.rateLimitThis(user, requestIp, {
key: 'wsmessage',
duration: ms('2sec'),
max: 4090,
max: 4096,
});
};
......
......@@ -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--;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment