Keep alive Riak connections by default

This commit is contained in:
Evgeniy Khramtsov 2016-03-22 19:32:30 +03:00
parent b90c3764c0
commit 61e914a83f
2 changed files with 8 additions and 1 deletions

View File

@ -73,7 +73,13 @@ start_link(Num, Server, Port, _StartInterval, Options) ->
%% @private
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
get_proc(I) ->

View File

@ -109,6 +109,7 @@ init([]) ->
Options = lists:filter(
fun(X) -> X /= nil end,
[auto_reconnect,
{keepalive, true},
if CACertFile /= nil -> {cacertfile ,CACertFile};
true -> nil
end,