fix(emqx_connector): start emqx_connector_mysql failed
This commit is contained in:
parent
5d52ce044d
commit
49c5edce2e
|
@ -1,7 +1,7 @@
|
|||
%%-*- mode: erlang -*-
|
||||
%% emqx_connector config mapping
|
||||
|
||||
{mapping, "connectors", "connectors", [
|
||||
{mapping, "connectors", "emqx_connector.connectors", [
|
||||
{default, []},
|
||||
{datatype, string}
|
||||
]}.
|
|
@ -6,7 +6,8 @@
|
|||
{applications,
|
||||
[kernel,
|
||||
stdlib,
|
||||
emqx_resource
|
||||
emqx_resource,
|
||||
ecpool
|
||||
]},
|
||||
{env,[]},
|
||||
{modules, []},
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
-export([start/2, stop/1]).
|
||||
|
||||
-export([load_config/0]).
|
||||
|
||||
start(_StartType, _StartArgs) ->
|
||||
load_config(),
|
||||
emqx_connector_sup:start_link().
|
||||
|
|
|
@ -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".
|
||||
|
|
Loading…
Reference in New Issue