mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 16:52:25 -05:00
[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
This commit is contained in:
parent
1312695c46
commit
d56a8d095e
4 changed files with 208 additions and 40 deletions
|
|
@ -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("[]")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue