mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
mypy: Enable new error explicit-override.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
d257002ad8
commit
a50eb2e809
@@ -5,6 +5,7 @@ from typing import Any, Callable, Optional
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand, CommandError, CommandParser
|
||||
from returns.curry import partial
|
||||
from typing_extensions import override
|
||||
|
||||
from zerver.lib.rate_limiter import RateLimitedUser, client
|
||||
from zerver.models import get_user_profile_by_id
|
||||
@@ -16,6 +17,7 @@ class Command(BaseCommand):
|
||||
|
||||
Usage: ./manage.py [--trim] check_redis"""
|
||||
|
||||
@override
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
parser.add_argument("-t", "--trim", action="store_true", help="Actually trim excess")
|
||||
|
||||
@@ -46,6 +48,7 @@ than max_api_calls! (trying to trim) %s %s",
|
||||
client.expire(key, entity.max_api_window())
|
||||
trim_func(key, max_calls)
|
||||
|
||||
@override
|
||||
def handle(self, *args: Any, **options: Any) -> None:
|
||||
if not settings.RATE_LIMITING:
|
||||
raise CommandError("This machine is not using Redis or rate limiting, aborting")
|
||||
|
||||
Reference in New Issue
Block a user