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