task_wrapper now ignores ExitRequest

This commit is contained in:
DevilXD committed 2022-08-24 12:34:14 +02:00
1 parent 53d14d3dd7
commit 127822a26f
1 file changed
+3
+3
View File
@@ -19,6 +19,7 @@ from typing import (
import yarl import yarl
from constants import JsonType from constants import JsonType
from exceptions import ExitRequest
from constants import _resource_path as resource_path # noqa from constants import _resource_path as resource_path # noqa
if TYPE_CHECKING: if TYPE_CHECKING:
@@ -74,6 +75,8 @@ def task_wrapper(
async def wrapper(*args: _P.args, **kwargs: _P.kwargs): async def wrapper(*args: _P.args, **kwargs: _P.kwargs):
try: try:
await afunc(*args, **kwargs) await afunc(*args, **kwargs)
except ExitRequest:
pass
except Exception: except Exception:
logger.exception("Exception in task") logger.exception("Exception in task")
raise # raise up to the wrapping task raise # raise up to the wrapping task