Skip to content

Commit afe3e16

Browse files
committed
Fix typing
1 parent f5f85cb commit afe3e16

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/asyncapi_python/amqp/connection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515

1616
from functools import cache
17-
from typing import TypeAlias
1817
from aio_pika.robust_connection import (
1918
AbstractRobustConnection,
2019
AbstractRobustChannel,

src/asyncapi_python/amqp/endpoint/receiver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ async def start(self) -> None:
4545
print("start", self._op)
4646
if self._fn:
4747
async with self._params.pool.acquire() as ch:
48-
if self._params.amqp_params.prefetch_count:
49-
await ch.set_qos(prefetch_count=self._params.amqp_params.prefetch_count)
48+
if prefetch_count := self._params.amqp_params.get("prefetch_count"):
49+
await ch.set_qos(prefetch_count=prefetch_count)
5050
q = self._queue = await self._declare(ch)
5151
self._consumer_tag = await q.consume(self._consumer)
5252
return

src/asyncapi_python/amqp/params.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import TypedDict
22

3+
34
class AmqpParams(TypedDict, total=False):
4-
prefetch_count: str
5+
prefetch_count: int

0 commit comments

Comments
 (0)