Skip to content

Commit 7e2e7b7

Browse files
committed
rabbit_feature_flags: Support relative setting in forced_feature_flags_on_init
[Why] We already support that from the environment variable, it is easy to add to the configuration setting.
1 parent 3846e5e commit 7e2e7b7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

deps/rabbit/src/rabbit_ff_controller.erl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -850,16 +850,23 @@ get_forced_feature_flag_names_from_env() ->
850850
end.
851851

852852
-spec get_forced_feature_flag_names_from_config() -> Ret when
853-
Ret :: {ok, FeatureNames | undefined},
854-
FeatureNames :: [rabbit_feature_flags:feature_name()].
853+
Ret :: {ok, Abs | Rel | undefined},
854+
Abs :: [rabbit_feature_flags:feature_name()],
855+
Rel :: {rel,
856+
[rabbit_feature_flags:feature_name()],
857+
[rabbit_feature_flags:feature_name()]}.
855858
%% @private
856859

857860
get_forced_feature_flag_names_from_config() ->
858861
Value = application:get_env(
859862
rabbit, forced_feature_flags_on_init, undefined),
860863
case Value of
861-
undefined -> {ok, Value};
862-
_ when is_list(Value) -> {ok, Value}
864+
undefined ->
865+
{ok, Value};
866+
_ when is_list(Value) ->
867+
{ok, Value};
868+
{rel, Plus, Minus} when is_list(Plus) andalso is_list(Minus) ->
869+
{ok, Value}
863870
end.
864871

865872
-spec enable_required_task() -> Ret when

0 commit comments

Comments
 (0)