Bläddra i källkod

fix(emqx_connector): start emqx_connector_mysql failed

Shawn 4 år sedan
förälder
incheckning
49c5edce2e

+ 1 - 1
apps/emqx_connector/priv/emqx_connector.schema

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

+ 2 - 1
apps/emqx_connector/src/emqx_connector.app.src

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

+ 2 - 0
apps/emqx_connector/src/emqx_connector_app.erl

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

+ 1 - 1
apps/emqx_resource/src/emqx_resource_instance.erl

@@ -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".