diff options
author | 2023-12-16 11:53:42 +0000 | |
---|---|---|
committer | 2023-12-16 12:53:42 +0100 | |
commit | d56a8d095e8fe84422ef4098d1e1a25198da17a1 (patch) | |
tree | cb34cb50335098492c863e4630dfd0b8da10d6c5 /internal/api/util/response.go | |
parent | [docs]: Update FAQ and ROADMAP (#2458) (diff) | |
download | gotosocial-d56a8d095e8fe84422ef4098d1e1a25198da17a1.tar.xz |
[performance] simpler throttling logic (#2407)
* reduce complexity of throttling logic to use 1 queue and an atomic int
* use atomic add instead of CAS, add throttling test
Diffstat (limited to 'internal/api/util/response.go')
-rw-r--r-- | internal/api/util/response.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/api/util/response.go b/internal/api/util/response.go index e22bac545..150d2ac2e 100644 --- a/internal/api/util/response.go +++ b/internal/api/util/response.go @@ -42,6 +42,12 @@ var ( StatusInternalServerErrorJSON = mustJSON(map[string]string{ "status": http.StatusText(http.StatusInternalServerError), }) + ErrorCapacityExceeded = mustJSON(map[string]string{ + "error": "server capacity exceeded!", + }) + ErrorRateLimitReached = mustJSON(map[string]string{ + "error": "rate limit reached!", + }) EmptyJSONObject = mustJSON("{}") EmptyJSONArray = mustJSON("[]") |