From e3ccc3765bd10adb15f309a4d4b44491c8f9509a Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Fri, 9 Sep 2022 18:48:17 +0300 Subject: [PATCH] Drop meaningless deadline redefinition (#19) --- src/woody_client.erl | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/woody_client.erl b/src/woody_client.erl index 16ab512..2357636 100644 --- a/src/woody_client.erl +++ b/src/woody_client.erl @@ -16,7 +16,6 @@ event_handler := woody:ev_handlers(), protocol => thrift, transport => http, - deadline => woody:deadline(), %% Set to override protocol handler module selection, useful for test purposes, rarely %% if ever needed otherwise. protocol_handler_override => module(), @@ -52,8 +51,7 @@ call(Request, Options) -> | {exception, woody_error:business_error()} | no_return(). call(Request, Options = #{event_handler := EvHandler}, Context) -> - Deadline = maps:get(deadline, Context, undefined), - Child = attach_deadline(Deadline, woody_context:new_child(Context)), + Child = woody_context:new_child(Context), WoodyState = woody_state:new(client, Child, EvHandler), case call_safe(Request, Options, WoodyState) of Result = {ok, _} -> @@ -94,8 +92,3 @@ handle_client_error(Class, Error, Stacktrace, WoodyState) -> final => false }), {error, {system, {internal, result_unexpected, <<"client error: ", Details/binary>>}}}. - -attach_deadline(undefined, Context) -> - Context; -attach_deadline(Deadline, Context) -> - woody_context:set_deadline(Deadline, Context).