Skip to content

Commit 35e93c9

Browse files
Allow InitialCredit/MoreCreditAfter of zero (#13067) (#13068)
#13046 introduced additional checks which prevent setting `{credit_flow_default_credit,{0,0}}`. Setting credits to zero allows disabling the credit flow mechanism (we use it in our benchmarks and mention for example in https://www.rabbitmq.com/blog/2023/03/21/native-mqtt) (cherry picked from commit a4634d3) Co-authored-by: Michal Kuratczyk <[email protected]>
1 parent ca70496 commit 35e93c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

deps/rabbit/src/rabbit.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,8 +1761,8 @@ persist_static_configuration() ->
17611761
{ok, {InitialCredit, MoreCreditAfter}}
17621762
when is_integer(InitialCredit) andalso
17631763
is_integer(MoreCreditAfter) andalso
1764-
InitialCredit > 0 andalso
1765-
MoreCreditAfter > 0 andalso
1764+
InitialCredit >= 0 andalso
1765+
MoreCreditAfter >= 0 andalso
17661766
MoreCreditAfter =< InitialCredit ->
17671767
{InitialCredit, MoreCreditAfter};
17681768
Other ->

0 commit comments

Comments
 (0)