Преглед изворни кода

chore: support list(tuple()) for schema_with_examples/3

zhongwencool пре 2 година
родитељ
комит
b343653769

+ 2 - 1
apps/emqx_dashboard/src/emqx_dashboard_swagger.erl

@@ -185,7 +185,8 @@ fields(meta) ->
 schema_with_example(Type, Example) ->
     hoconsc:mk(Type, #{examples => #{<<"example">> => Example}}).
 
--spec schema_with_examples(hocon_schema:type(), map()) -> hocon_schema:field_schema_map().
+-spec schema_with_examples(hocon_schema:type(), map() | list(tuple())) ->
+    hocon_schema:field_schema_map().
 schema_with_examples(Type, Examples) ->
     hoconsc:mk(Type, #{examples => #{<<"examples">> => Examples}}).
 

+ 1 - 1
apps/emqx_prometheus/src/emqx_prometheus_config.erl

@@ -48,7 +48,7 @@ remove_handler() ->
 
 post_config_update(?PROMETHEUS, _Req, New, Old, AppEnvs) ->
     update_prometheus(AppEnvs),
-    update_push_gateway(New),
+    _ = update_push_gateway(New),
     update_auth(New, Old);
 post_config_update(_ConfPath, _Req, _NewConf, _OldConf, _AppEnvs) ->
     ok.

+ 1 - 0
apps/emqx_prometheus/src/emqx_prometheus_sup.erl

@@ -44,6 +44,7 @@ start_link() ->
 start_child(Mod, Conf) when is_atom(Mod) ->
     assert_started(supervisor:start_child(?MODULE, ?CHILD(Mod, Conf))).
 
+-spec update_child(pid() | atom(), map()) -> ok.
 update_child(Pid, Conf) ->
     erlang:send(Pid, {update, Conf}),
     ok.