Keep alive Riak connections by default
This commit is contained in:
parent
b90c3764c0
commit
61e914a83f
|
@ -73,7 +73,13 @@ start_link(Num, Server, Port, _StartInterval, Options) ->
|
||||||
|
|
||||||
%% @private
|
%% @private
|
||||||
is_connected() ->
|
is_connected() ->
|
||||||
catch riakc_pb_socket:is_connected(get_random_pid()).
|
lists:all(
|
||||||
|
fun({_Id, Pid, _Type, _Modules}) when is_pid(Pid) ->
|
||||||
|
case catch riakc_pb_socket:is_connected(get_random_pid()) of
|
||||||
|
true -> true;
|
||||||
|
_ -> false
|
||||||
|
end
|
||||||
|
end, supervisor:which_children(ejabberd_riak_sup)).
|
||||||
|
|
||||||
%% @private
|
%% @private
|
||||||
get_proc(I) ->
|
get_proc(I) ->
|
||||||
|
|
|
@ -109,6 +109,7 @@ init([]) ->
|
||||||
Options = lists:filter(
|
Options = lists:filter(
|
||||||
fun(X) -> X /= nil end,
|
fun(X) -> X /= nil end,
|
||||||
[auto_reconnect,
|
[auto_reconnect,
|
||||||
|
{keepalive, true},
|
||||||
if CACertFile /= nil -> {cacertfile ,CACertFile};
|
if CACertFile /= nil -> {cacertfile ,CACertFile};
|
||||||
true -> nil
|
true -> nil
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in New Issue