Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: emqx/ekka
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 083fdf30a11322cc4752493862d1b06a7ddd650c
Choose a base ref
..
head repository: emqx/ekka
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2b52e9786efac09db5091ae60304f9a1a6acd1de
Choose a head ref
Showing with 7 additions and 6 deletions.
  1. +1 −1 rebar.config
  2. +1 −0 src/ekka.app.src
  3. +4 −4 src/ekka_cluster_etcd.erl
  4. +1 −1 test/mod_etcd.erl
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@

{dialyzer,
[{warnings, [unknown]},
{plt_extra_apps, [jiffy, mria]}
{plt_extra_apps, [mria]}
]}.

{profiles,
1 change: 1 addition & 0 deletions src/ekka.app.src
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
stdlib,
inets,
eetcd,
jsone,
snabbkaffe,
mria
]},
8 changes: 4 additions & 4 deletions src/ekka_cluster_etcd.erl
Original file line number Diff line number Diff line change
@@ -343,9 +343,9 @@ init(Options) ->
Servers = proplists:get_value(server, Options, []),
Prefix = proplists:get_value(prefix, Options),
Hosts = [remove_scheme(Server) || Server <- Servers],
{Transport, TransportOpts} = case ssl_options(Options) of
[] -> {tcp, []};
[SSL] -> SSL
TransportOpts = case ssl_options(Options) of
[] -> [{transport, tcp}];
[{ssl, TLSOpts}] -> [{transport, tls}, {tls_opts, TLSOpts}]
end,
%% At the time of writing, the etcd connection process does not
%% close when this process dies. So, when this processes is
@@ -354,7 +354,7 @@ init(Options) ->
%% that no connection with this name exists before opening it
%% (again).
eetcd:close(?MODULE),
{ok, _Pid} = eetcd:open(?MODULE, Hosts, Transport, TransportOpts),
{ok, _Pid} = eetcd:open(?MODULE, Hosts, TransportOpts),
{ok, #{'ID' := ID}} = eetcd_lease:grant(?MODULE, 5),
{ok, Pid2} = eetcd_lease:keep_alive(?MODULE, ID),
true = link(Pid2),
2 changes: 1 addition & 1 deletion test/mod_etcd.erl
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ do(_Req = #mod{method = "GET", request_uri = "/v2/keys/" ++ _Uri}) ->
Nodes)
}
},
Response = {200, binary_to_list(jiffy:encode(Body))},
Response = {200, binary_to_list(jsone:encode(Body))},
{proceed, [{response, Response}]};
do(_Req = #mod{request_uri = "/v2/keys/" ++ _Uri}) ->
{proceed, [{response, {200, "{\"errorCode\": 0}"}}]};