mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-25 23:33:31 -06:00
[feature] Add rate limit exceptions option, use ISO8601 for rate limit reset (#2151)
* start updating rate limiting, add exceptions * tests, comments, tidying up * add rate limiting exceptions to example config * envparsing * nolint * apply kimbediff * add examples
This commit is contained in:
parent
94d16631bc
commit
8f38dc2e7f
12 changed files with 402 additions and 27 deletions
|
|
@ -266,10 +266,11 @@ var Start action.GTSAction = func(ctx context.Context) error {
|
|||
|
||||
// create required middleware
|
||||
// rate limiting
|
||||
limit := config.GetAdvancedRateLimitRequests()
|
||||
clLimit := middleware.RateLimit(limit) // client api
|
||||
s2sLimit := middleware.RateLimit(limit) // server-to-server (AP)
|
||||
fsLimit := middleware.RateLimit(limit) // fileserver / web templates
|
||||
rlLimit := config.GetAdvancedRateLimitRequests()
|
||||
rlExceptions := config.GetAdvancedRateLimitExceptions()
|
||||
clLimit := middleware.RateLimit(rlLimit, rlExceptions) // client api
|
||||
s2sLimit := middleware.RateLimit(rlLimit, rlExceptions) // server-to-server (AP)
|
||||
fsLimit := middleware.RateLimit(rlLimit, rlExceptions) // fileserver / web templates
|
||||
|
||||
// throttling
|
||||
cpuMultiplier := config.GetAdvancedThrottlingMultiplier()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue