lemmy/crates/utils/src
dullbananas a14657d124
Refactor rate limiter and improve rate limit bucket cleanup (#3937)
* Update rate_limiter.rs

* Update mod.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update mod.rs

* Update scheduled_tasks.rs

* Shrink `RateLimitBucket`

* Update rate_limiter.rs

* Update mod.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update mod.rs

* Update rate_limiter.rs

* fmt

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* Update rate_limiter.rs

* rerun ci

* Update rate_limiter.rs

* Undo changes to  fields

* Manually undo changes to RateLimitBucket fields

* fmt

* Bucket cleanup loop in rate_limit/mod.rs

* Remove rate limit bucket cleanup from scheduled_tasks.rs

* Remove ;

* Remove UNINITIALIZED_TOKEN_AMOUNT

* Update rate_limiter.rs

* fmt

* Update rate_limiter.rs

* fmt

* Update rate_limiter.rs

* fmt

* Update rate_limiter.rs

* stuff

* MapLevel trait

* fix merge

* Prevent negative numbers in buckets

* Clean up MapLevel::check

* MapLevel::remove_full_buckets

* stuff

* Use remove_full_buckets to avoid allocations

* stuff

* remove tx

* Remove RateLimitConfig

* Rename settings_updated_channel to rate_limit_cell

* Remove global rate limit cell

* impl Default for RateLimitCell

* bucket_configs doc comment to explain EnumMap

* improve test_rate_limiter

* rename default to with_test_config

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
Co-authored-by: Nutomic <me@nutomic.com>
2023-10-19 15:31:51 +02:00
..
rate_limit Refactor rate limiter and improve rate limit bucket cleanup (#3937) 2023-10-19 15:31:51 +02:00
settings Mention max length for site name in config (fixes #3006) (#4010) 2023-10-04 15:09:25 +02:00
utils Handle invalid ban expires values (fixes #4045) (#4046) 2023-10-17 13:25:35 -04:00
apub.rs Fixing `.drone.yml` (#2677) 2023-01-30 14:17:24 -05:00
cache_header.rs Add http cache for webfingers (#3317) 2023-07-19 06:09:04 -04:00
email.rs Fix wrong SMTP port when TLS is being used (fixes #3574) (#3607) 2023-07-13 13:10:14 +02:00
error.rs Handle invalid ban expires values (fixes #4045) (#4046) 2023-10-17 13:25:35 -04:00
lib.rs Add db table for login tokens which allows for invalidation (#3818) 2023-10-09 12:46:12 +02:00
main.rs Adjust the config check to be a separate faster to compile binary (#3313) 2023-06-26 06:23:21 -04:00
request.rs Add cargo feature for building lemmy_api_common with mininum deps (#2243) 2022-05-03 17:44:13 +00:00
response.rs Return HTTP status 503 to all requests during startup (fixes #3780) (#4005) 2023-10-04 18:19:58 -04:00
version.rs For untagged commits, include hash in version name (fixes #1563) 2021-04-12 13:47:58 +02:00