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:
commit
fd0ecb22cf
16 changed files with 719 additions and 400 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue