diff options
| author | dakkar <dakkar@thenautilus.net> | 2024-08-18 15:48:06 +0000 |
|---|---|---|
| committer | dakkar <dakkar@thenautilus.net> | 2024-08-18 15:48:06 +0000 |
| commit | 5ae21970d7f8b0287d7e2380be8585fbba449afd (patch) | |
| tree | 4747771a7c7a2c646596f4437ac883929dd53218 /packages/backend/src/server/api/StreamingApiServerService.ts | |
| parent | merge: fix lints (!594) (diff) | |
| parent | relax websocket rate limits (diff) | |
| download | sharkey-5ae21970d7f8b0287d7e2380be8585fbba449afd.tar.gz sharkey-5ae21970d7f8b0287d7e2380be8585fbba449afd.tar.bz2 sharkey-5ae21970d7f8b0287d7e2380be8585fbba449afd.zip | |
merge: relax websocket rate limits (!601)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/601
Approved-by: Julia Johannesen <julia@insertdomain.name>
Approved-by: Marie <2-Marie@users.noreply.activitypub.software>
Diffstat (limited to 'packages/backend/src/server/api/StreamingApiServerService.ts')
| -rw-r--r-- | packages/backend/src/server/api/StreamingApiServerService.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/backend/src/server/api/StreamingApiServerService.ts b/packages/backend/src/server/api/StreamingApiServerService.ts index 2070ab6106..a2dafb2ebd 100644 --- a/packages/backend/src/server/api/StreamingApiServerService.ts +++ b/packages/backend/src/server/api/StreamingApiServerService.ts @@ -100,7 +100,6 @@ export class StreamingApiServerService { key: 'wsconnect', duration: ms('5min'), max: 32, - minInterval: ms('1sec'), })) { socket.write('HTTP/1.1 429 Rate Limit Exceeded\r\n\r\n'); socket.destroy(); @@ -145,10 +144,14 @@ export class StreamingApiServerService { } const rateLimiter = () => { + // rather high limit, because when catching up at the top of a + // timeline, the frontend may render many many notes, each of + // which causes a message via `useNoteCapture` to ask for + // realtime updates of that note return this.rateLimitThis(user, requestIp, { key: 'wsmessage', - duration: ms('5sec'), - max: 256, + duration: ms('2sec'), + max: 4090, }); }; |