File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments