Skip to content

Commit 3dd3433

Browse files
Finish off #13046
1 parent 27e4d4b commit 3dd3433

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

deps/rabbit/src/rabbit.erl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,17 +1755,19 @@ persist_static_configuration() ->
17551755
]),
17561756

17571757
%% Disallow the following two cases:
1758-
%% 1. Negative value
1759-
%% 2. MoreCreditAfter larger than InitialCredit.
1758+
%% 1. Negative values
1759+
%% 2. MoreCreditAfter greater than InitialCredit
17601760
CreditFlowDefaultCredit = case application:get_env(?MODULE, credit_flow_default_credit) of
17611761
{ok, {InitialCredit, MoreCreditAfter}}
17621762
when is_integer(InitialCredit) andalso
1763-
is_integer(MoreCreditAfter) andalso
1764-
MoreCreditAfter < InitialCredit ->
1763+
is_integer(MoreCreditAfter) andalso
1764+
InitialCredit > 0 andalso
1765+
MoreCreditAfter > 0 andalso
1766+
MoreCreditAfter < InitialCredit ->
17651767
{InitialCredit, MoreCreditAfter};
1766-
_ ->
1767-
rabbit_log:error("Failed to start due to invalid value of credit_flow_default_credit."),
1768-
throw({error, invalid_credit_flow_default_credit_value})
1768+
Other ->
1769+
rabbit_log:error("Refusing to boot due to an invalid value of 'rabbit.credit_flow_default_credit'"),
1770+
throw({error, {invalid_credit_flow_default_credit_value, Other}})
17691771
end,
17701772
ok = persistent_term:put(credit_flow_default_credit, CreditFlowDefaultCredit),
17711773

0 commit comments

Comments
 (0)