Merge pull request #12990 from thalesmg/fix-mv-conf-update-r57-20240508

fix(message validation): don't call `emqx_conf:update` during boot
This commit is contained in:
Thales Macedo Garitezi 2024-05-08 16:58:15 -03:00 committed by GitHub
commit d3905b6336
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 2 deletions

View File

@ -69,10 +69,22 @@ remove_handler() ->
ok. ok.
load() -> load() ->
lists:foreach(fun insert/1, emqx:get_config(?VALIDATIONS_CONF_PATH, [])). Validations = emqx:get_config(?VALIDATIONS_CONF_PATH, []),
lists:foreach(
fun({Pos, Validation}) ->
ok = emqx_message_validation_registry:insert(Pos, Validation)
end,
lists:enumerate(Validations)
).
unload() -> unload() ->
lists:foreach(fun delete/1, emqx:get_config(?VALIDATIONS_CONF_PATH, [])). Validations = emqx:get_config(?VALIDATIONS_CONF_PATH, []),
lists:foreach(
fun(Validation) ->
ok = emqx_message_validation_registry:delete(Validation)
end,
Validations
).
-spec list() -> [validation()]. -spec list() -> [validation()].
list() -> list() ->