From 127822a26fbd40f884733ebd5db8718aa5b53cdd Mon Sep 17 00:00:00 2001 From: DevilXD Date: Wed, 24 Aug 2022 12:34:14 +0200 Subject: [PATCH] task_wrapper now ignores ExitRequest --- utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils.py b/utils.py index 1f500a8..6a43ea5 100644 --- a/utils.py +++ b/utils.py @@ -19,6 +19,7 @@ from typing import ( import yarl from constants import JsonType +from exceptions import ExitRequest from constants import _resource_path as resource_path # noqa if TYPE_CHECKING: @@ -74,6 +75,8 @@ def task_wrapper( async def wrapper(*args: _P.args, **kwargs: _P.kwargs): try: await afunc(*args, **kwargs) + except ExitRequest: + pass except Exception: logger.exception("Exception in task") raise # raise up to the wrapping task