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] committed Jul 23, 2024
1 parent 526edc4 commit e0d7108
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 @@ -326,13 +326,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 @@ -350,19 +353,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 e0d7108

Please sign in to comment.