Skip to content

Commit c0374eb

Browse files
igor-gorohovskys3rius
andauthoredMar 24, 2025
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 <win10@list.ru>
1 parent 3356437 commit c0374eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎taskiq/result_backends/dummy.py

+6
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)
Failed to load comments.