Skip to content

Commit b9e8367

Browse files
committed
Hints to static analysis
1 parent f6aeecb commit b9e8367

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sentry/taskworker/retry.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from enum import Enum
44
from multiprocessing.context import TimeoutError
5+
from typing import NoReturn
56

67
from celery import current_task
78
from sentry_protos.taskbroker.v1.taskbroker_pb2 import (
@@ -41,7 +42,7 @@ def to_proto(self) -> OnAttemptsExceeded.ValueType:
4142
raise ValueError(f"Unknown LastAction: {self}")
4243

4344

44-
def retry_task(exc: Exception | None = None) -> None:
45+
def retry_task(exc: Exception | None = None) -> NoReturn:
4546
"""
4647
Helper for triggering retry errors.
4748
If all retries have been consumed, this will raise a
@@ -55,6 +56,7 @@ def retry_task(exc: Exception | None = None) -> None:
5556
celery_retry = getattr(current_task, "retry", None)
5657
if celery_retry:
5758
current_task.retry(exc=exc)
59+
assert False, "unreachable"
5860
else:
5961
current = taskworker_current_task()
6062
if current and not current.retries_remaining:

0 commit comments

Comments
 (0)