Skip to content

Commit

Permalink
Keep alive Riak connections by default
Browse files Browse the repository at this point in the history
  • Loading branch information
zinid committed Mar 22, 2016
1 parent 35f66b2 commit 968eb25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ejabberd_riak.erl
Expand Up @@ -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) ->
Expand Down
1 change: 1 addition & 0 deletions src/ejabberd_riak_sup.erl
Expand Up @@ -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,
Expand Down

0 comments on commit 968eb25

Please sign in to comment.