Skip to content

Commit

Permalink
🛠️ apply pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
getsantry[bot] authored Jul 23, 2024
1 parent d5c9975 commit 8609b63
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/sentry/utils/circuit_breaker2.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,16 @@ def _get_state_and_remaining_time(
@overload
def _get_controlling_quota(
self, state: Literal[CircuitBreakerState.OK, CircuitBreakerState.RECOVERY]
) -> Quota: ...
) -> Quota:
...

@overload
def _get_controlling_quota(self, state: Literal[CircuitBreakerState.BROKEN]) -> None: ...
def _get_controlling_quota(self, state: Literal[CircuitBreakerState.BROKEN]) -> None:
...

@overload
def _get_controlling_quota(self) -> Quota | None: ...
def _get_controlling_quota(self) -> Quota | None:
...

def _get_controlling_quota(self, state: CircuitBreakerState | None = None) -> Quota | None:
"""
Expand All @@ -255,19 +258,24 @@ def _get_controlling_quota(self, state: CircuitBreakerState | None = None) -> Qu
return controlling_quota_by_state[_state]

@overload
def _get_remaining_error_quota(self, quota: None, window_end: int | None) -> None: ...
def _get_remaining_error_quota(self, quota: None, window_end: int | None) -> None:
...

@overload
def _get_remaining_error_quota(self, quota: Quota, window_end: int | None) -> int: ...
def _get_remaining_error_quota(self, quota: Quota, window_end: int | None) -> int:
...

@overload
def _get_remaining_error_quota(self, quota: None) -> None: ...
def _get_remaining_error_quota(self, quota: None) -> None:
...

@overload
def _get_remaining_error_quota(self, quota: Quota) -> int: ...
def _get_remaining_error_quota(self, quota: Quota) -> int:
...

@overload
def _get_remaining_error_quota(self) -> int | None: ...
def _get_remaining_error_quota(self) -> int | None:
...

def _get_remaining_error_quota(
self, quota: Quota | None = None, window_end: int | None = None
Expand Down

0 comments on commit 8609b63

Please sign in to comment.