I noticed this in some profiling. Basically, we prune the ratelimiters by copying and iterating over every entry every 60 seconds. Instead, let's use a wheel timer to track when we should potentially prune a given key, and then we a) check fewer keys, and b) can run more frequently. Hopefully this should mean we don't have a large pause everytime we prune a ratelimiter with lots of keys. Also fixes a bug where we didn't prune entries that were added via `record_action` and never subsequently updated. This affected the media and joins-per-room ratelimiter. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_auth.py | ||
| test_errors.py | ||
| test_filtering.py | ||
| test_ratelimiting.py | ||
| test_urls.py | ||