fix: delete plugin from configure when uninstall
This commit is contained in:
parent
8528d76371
commit
35d066e3d5
|
@ -421,7 +421,7 @@ delete_package(Name) ->
|
|||
case emqx_plugins:ensure_stopped(Name) of
|
||||
ok ->
|
||||
_ = emqx_plugins:ensure_disabled(Name),
|
||||
_ = emqx_plugins:purge(Name),
|
||||
_ = emqx_plugins:ensure_uninstalled(Name),
|
||||
_ = emqx_plugins:delete_package(Name);
|
||||
Error ->
|
||||
Error
|
||||
|
|
|
@ -127,9 +127,16 @@ ensure_uninstalled(NameVsn) ->
|
|||
hint => "disable_the_plugin_first"
|
||||
}};
|
||||
_ ->
|
||||
purge(NameVsn)
|
||||
purge(NameVsn),
|
||||
ensure_delete(NameVsn)
|
||||
end.
|
||||
|
||||
ensure_delete(NameVsn0) ->
|
||||
NameVsn = bin(NameVsn0),
|
||||
List = configured(),
|
||||
put_configured(lists:filter(fun(#{name_vsn := N1}) -> bin(N1) =/= NameVsn end, List)),
|
||||
ok.
|
||||
|
||||
%% @doc Ensure a plugin is enabled to the end of the plugins list.
|
||||
-spec ensure_enabled(name_vsn()) -> ok | {error, any()}.
|
||||
ensure_enabled(NameVsn) ->
|
||||
|
|
Loading…
Reference in New Issue