File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 11import asyncio
2+ from logging import getLogger
23from time import time
34from typing import TYPE_CHECKING , Any , Generic , Optional
45
910 ResultIsReadyError ,
1011 TaskiqResultTimeoutError ,
1112)
13+ from taskiq .result_backends .dummy import DummyResultBackend
1214
1315if TYPE_CHECKING : # pragma: no cover
1416 from taskiq .abc .result_backend import AsyncResultBackend
1820_ReturnType = TypeVar ("_ReturnType" )
1921
2022
23+ logger = getLogger ("taskiq" )
24+
25+
2126class AsyncTaskiqTask (Generic [_ReturnType ]):
2227 """AsyncTask for AsyncResultBackend."""
2328
@@ -83,6 +88,9 @@ async def wait_result(
8388 become ready in provided period of time.
8489 :return: task's return value.
8590 """
91+ if isinstance (self .result_backend , DummyResultBackend ):
92+ logger .warning ("No result backend configured. Returning dummy result..." )
93+
8694 start_time = time ()
8795 while not await self .is_ready ():
8896 await asyncio .sleep (check_interval )
You can’t perform that action at this time.
0 commit comments