fix(emqx_connector): start emqx_connector_mysql failed

This commit is contained in:
Shawn 2021-06-02 16:28:52 +08:00
parent 5d52ce044d
commit 49c5edce2e
4 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,7 @@
%%-*- mode: erlang -*-
%% emqx_connector config mapping
{mapping, "connectors", "connectors", [
{mapping, "connectors", "emqx_connector.connectors", [
{default, []},
{datatype, string}
]}.

View File

@ -6,7 +6,8 @@
{applications,
[kernel,
stdlib,
emqx_resource
emqx_resource,
ecpool
]},
{env,[]},
{modules, []},

View File

@ -11,6 +11,8 @@
-export([start/2, stop/1]).
-export([load_config/0]).
start(_StartType, _StartArgs) ->
load_config(),
emqx_connector_sup:start_link().

View File

@ -134,7 +134,7 @@ save_config_to_disk(InstId, ResourceType, Config) ->
%% will dump configs for all instances (from an ETS table) to a file.
file:write_file(filename:join([emqx_data_dir(), binary_to_list(InstId) ++ ".conf"]),
jsx:encode(#{id => InstId, resource_type => ResourceType,
config => emqx_resource:call_config_to_file(Config)})).
config => emqx_resource:call_config_to_file(ResourceType, Config)})).
emqx_data_dir() ->
"data".