mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
This refactors rate limit related functions from `zerver.decorator` to zerver.lib.rate_limiter. We conditionally import `RemoteZulipServer`, `RequestNotes`, and `RateLimitedRemoteZulipServer` to avoid circular dependency. Most instances of importing these functions from `zerver.decorator` got updated, with a few exceptions in `zerver.tests.test_decorators`, where we do want to mock the rate limiting functions imported in `zerver.decorator`. The same goes with the mocking example in the "testing-with-django" documentation. Signed-off-by: Zixuan James Li <p359101898@gmail.com>