Skip to content

Commit

Permalink
Fix: add exception for no_ack and max workers
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Dumchenko committed Dec 24, 2024
1 parent d80bdd1 commit f99275e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions faststream/redis/subscriber/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def create_subscriber(
) -> SubsciberType:
validate_options(channel=channel, list=list, stream=stream)


if (channel_sub := PubSub.validate(channel)) is not None:
if max_workers > 1:
return AsyncAPIChannelConcurrentSubscriber(
Expand Down Expand Up @@ -100,6 +101,8 @@ def create_subscriber(
include_in_schema=include_in_schema,
)
else:
if no_ack and max_workers > 1:
raise SetupError("Max workers not work with manual no_ack mode.")
if max_workers > 1:
return AsyncAPIStreamConcurrentSubscriber(
stream=stream_sub,
Expand Down

0 comments on commit f99275e

Please sign in to comment.