Skip to content

Commit

Permalink
fix: Disabled excessive throttling for BatchSubscriber.
Browse files Browse the repository at this point in the history
  • Loading branch information
DABND19 committed Dec 21, 2024
1 parent 51477a5 commit 01a4b2c
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions faststream/confluent/subscriber/usecase.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,18 +378,14 @@ def __init__(

async def get_msg(self) -> Optional[Tuple["Message", ...]]:
assert self.consumer, "You should setup subscriber at first." # nosec B101

messages = await self.consumer.getmany(
timeout=self.polling_interval,
max_records=self.max_records,
return (
await self.consumer.getmany(
timeout=self.polling_interval,
max_records=self.max_records,
)
or None
)

if not messages: # TODO: why we are sleeping here?
await anyio.sleep(self.polling_interval)
return None

return messages

def get_log_context(
self,
message: Optional["StreamMessage[Tuple[Message, ...]]"],
Expand Down

0 comments on commit 01a4b2c

Please sign in to comment.