Skip to content

Commit 40bc192

Browse files
committed
Merge branch 'release/0.4.1'
2 parents 88dbe3a + 8c85902 commit 40bc192

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "taskiq"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
description = "Distributed task queue with full async support"
55
authors = ["Pavel Kirilin <[email protected]>"]
66
maintainers = ["Pavel Kirilin <[email protected]>"]

taskiq/abc/broker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def listen(self) -> AsyncGenerator[bytes, None]:
180180
def task(
181181
self,
182182
task_name: Callable[_FuncParams, _ReturnType],
183-
**lavels: Any,
183+
**labels: Any,
184184
) -> AsyncTaskiqDecoratedTask[_FuncParams, _ReturnType]: # pragma: no cover
185185
...
186186

taskiq/cli/worker/run.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def run_worker(args: WorkerArgs) -> None: # noqa: WPS213
128128
and joins them all.
129129
130130
:param args: CLI arguments.
131+
132+
:raises ValueError: if reload flag is used, but dependencies are not installed.
131133
"""
132134
logging.basicConfig(
133135
level=logging.getLevelName(args.log_level),
@@ -137,10 +139,12 @@ def run_worker(args: WorkerArgs) -> None: # noqa: WPS213
137139
logger.info("Starting %s worker processes.", args.workers)
138140

139141
observer = None
140-
if Observer is not None:
141-
observer = Observer()
142142

143-
if observer is not None and args.reload:
143+
if args.reload and Observer is None:
144+
raise ValueError("To use '--reload' flag, please install 'taskiq[reload]'.")
145+
146+
if Observer is not None and args.reload:
147+
observer = Observer()
144148
observer.start()
145149
args.workers = 1
146150
logging.warning(

taskiq/middlewares/prometheus_middleware.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ def __init__(
5757
Histogram,
5858
start_http_server,
5959
)
60-
except ImportError:
61-
logger.warn(
62-
"Cannot initialize metrics. Please install 'taskiq[metrics]' extra.",
63-
)
64-
raise
60+
except ImportError as exc:
61+
raise ImportError(
62+
"Cannot initialize metrics. Please install 'taskiq[metrics]'.",
63+
) from exc
6564

6665
self.found_errors = Counter(
6766
"found_errors",

0 commit comments

Comments
 (0)