merge: Fix rate limits under multi-node environments (!809)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/809

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
Hazelnoot 2024-12-15 16:53:48 +00:00
commit fd0ecb22cf
16 changed files with 719 additions and 400 deletions

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;

View file

@ -17,10 +17,11 @@ export const meta = {
allowGet: true,
cacheSec: 60 * 60,
// 10 calls per 5 seconds
// Burst up to 100, then 2/sec average
limit: {
duration: 1000 * 5,
max: 10,
type: 'bucket',
size: 100,
dripRate: 500,
},
} as const;