summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-08-23 14:32:27 +0200
committerLibravatar GitHub <noreply@github.com>2023-08-23 14:32:27 +0200
commit8f38dc2e7f9dc7272c6882fff369be5e43dc711a (patch)
tree4b414789c96c05573f89ae3f23b4bd1c5870005e /cmd
parent[performance] Rework home timeline query to use cache more (#2148) (diff)
downloadgotosocial-8f38dc2e7f9dc7272c6882fff369be5e43dc711a.tar.xz
[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
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gotosocial/action/server/server.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/gotosocial/action/server/server.go b/cmd/gotosocial/action/server/server.go
index e966c46be..fc08c57ac 100644
--- a/cmd/gotosocial/action/server/server.go
+++ b/cmd/gotosocial/action/server/server.go
@@ -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()