From fc6f54602d9fe05c0c1c52f1d553a2ffe3eb1f70 Mon Sep 17 00:00:00 2001 From: Gilbert Wong Date: Wed, 8 May 2019 11:53:10 +0800 Subject: [PATCH] Fix plugin load bug --- src/emqx_plugins.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emqx_plugins.erl b/src/emqx_plugins.erl index f1beda41b..1c1185bf0 100644 --- a/src/emqx_plugins.erl +++ b/src/emqx_plugins.erl @@ -271,7 +271,7 @@ plugin_loaded(Name, true) -> case lists:member(Name, Names) of false -> %% write file if plugin is loaded - write_loaded(lists:append(Names, [Name])); + write_loaded(lists:append(Names, [{Name, true}])); true -> ignore end; @@ -308,7 +308,7 @@ write_loaded(AppNames) -> case file:open(File, [binary, write]) of {ok, Fd} -> lists:foreach(fun(Name) -> - file:write(Fd, iolist_to_binary(io_lib:format("~s.~n", [Name]))) + file:write(Fd, iolist_to_binary(io_lib:format("~p.~n", [Name]))) end, AppNames); {error, Error} -> ?LOG(error, "[Plugins] Open File ~p Error: ~p", [File, Error]),