Skip to content

Commit

Permalink
HELP-26267: set a default recv_timeout to address put attachement 201…
Browse files Browse the repository at this point in the history
… timeout errors (#2910)
  • Loading branch information
k-anderson authored and icehess committed Dec 7, 2016
1 parent 401ecf5 commit 90cc815
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/kazoo_couch/src/kz_couch_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,17 @@ maybe_add_auth(User, Pass, Options) ->
check_options(Options) ->
Routines = [fun convert_options/1
,fun filter_options/1
,fun maybe_default_recv_timeout/1
],
lists:foldl(fun(Fun, Opts) -> Fun(Opts) end, Options, Routines).

-spec maybe_default_recv_timeout(kz_proplist()) -> kz_proplist().
maybe_default_recv_timeout(Options) ->
case props:get_value('recv_timeout', Options) of
'undefined' -> [{'recv_timeout', 20000} | Options];
_Else -> Options
end.

filter_options(Options) ->
[ KV || {K, _} = KV <- Options, not lists:member(K, ?NO_OPTIONS)].

Expand Down

0 comments on commit 90cc815

Please sign in to comment.