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 29, 2024
1 parent 2af8277 commit 20e3df8
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 @@ -335,18 +335,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 20e3df8

Please sign in to comment.