File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from enum import Enum
4
4
from multiprocessing .context import TimeoutError
5
+ from typing import NoReturn
5
6
6
7
from celery import current_task
7
8
from sentry_protos .taskbroker .v1 .taskbroker_pb2 import (
@@ -41,7 +42,7 @@ def to_proto(self) -> OnAttemptsExceeded.ValueType:
41
42
raise ValueError (f"Unknown LastAction: { self } " )
42
43
43
44
44
- def retry_task (exc : Exception | None = None ) -> None :
45
+ def retry_task (exc : Exception | None = None ) -> NoReturn :
45
46
"""
46
47
Helper for triggering retry errors.
47
48
If all retries have been consumed, this will raise a
@@ -55,6 +56,7 @@ def retry_task(exc: Exception | None = None) -> None:
55
56
celery_retry = getattr (current_task , "retry" , None )
56
57
if celery_retry :
57
58
current_task .retry (exc = exc )
59
+ assert False , "unreachable"
58
60
else :
59
61
current = taskworker_current_task ()
60
62
if current and not current .retries_remaining :
You can’t perform that action at this time.
0 commit comments