Skip to content

Commit d35ef8d

Browse files
Warn if result backend is unset (#430)
* warn on .wait_result call if there is no result backend * warn user on dummy result backend level * use warn from warnings module --------- Co-authored-by: Pavel Kirilin <[email protected]>
1 parent 7159abb commit d35ef8d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

taskiq/result_backends/dummy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import warnings
12
from typing import Any, TypeVar
23

34
from taskiq.abc.result_backend import AsyncResultBackend
@@ -41,6 +42,11 @@ async def get_result(self, task_id: str, with_logs: bool = False) -> Any:
4142
:param with_logs: wether to fetch logs.
4243
:returns: TaskiqResult.
4344
"""
45+
warnings.warn(
46+
"No result backend configured. Returning dummy result...",
47+
stacklevel=2,
48+
)
49+
4450
return TaskiqResult(
4551
is_err=False,
4652
log=None,

0 commit comments

Comments
 (0)