mirror of
https://github.com/valitydev/woody_erlang.git
synced 2024-11-06 02:15:19 +00:00
Drop meaningless deadline redefinition
This commit is contained in:
parent
90d386c252
commit
2326bc9b06
@ -16,7 +16,6 @@
|
|||||||
event_handler := woody:ev_handlers(),
|
event_handler := woody:ev_handlers(),
|
||||||
protocol => thrift,
|
protocol => thrift,
|
||||||
transport => http,
|
transport => http,
|
||||||
deadline => woody:deadline(),
|
|
||||||
%% Set to override protocol handler module selection, useful for test purposes, rarely
|
%% Set to override protocol handler module selection, useful for test purposes, rarely
|
||||||
%% if ever needed otherwise.
|
%% if ever needed otherwise.
|
||||||
protocol_handler_override => module(),
|
protocol_handler_override => module(),
|
||||||
@ -52,8 +51,7 @@ call(Request, Options) ->
|
|||||||
| {exception, woody_error:business_error()}
|
| {exception, woody_error:business_error()}
|
||||||
| no_return().
|
| no_return().
|
||||||
call(Request, Options = #{event_handler := EvHandler}, Context) ->
|
call(Request, Options = #{event_handler := EvHandler}, Context) ->
|
||||||
Deadline = maps:get(deadline, Context, undefined),
|
Child = woody_context:new_child(Context),
|
||||||
Child = attach_deadline(Deadline, woody_context:new_child(Context)),
|
|
||||||
WoodyState = woody_state:new(client, Child, EvHandler),
|
WoodyState = woody_state:new(client, Child, EvHandler),
|
||||||
case call_safe(Request, Options, WoodyState) of
|
case call_safe(Request, Options, WoodyState) of
|
||||||
Result = {ok, _} ->
|
Result = {ok, _} ->
|
||||||
@ -94,8 +92,3 @@ handle_client_error(Class, Error, Stacktrace, WoodyState) ->
|
|||||||
final => false
|
final => false
|
||||||
}),
|
}),
|
||||||
{error, {system, {internal, result_unexpected, <<"client error: ", Details/binary>>}}}.
|
{error, {system, {internal, result_unexpected, <<"client error: ", Details/binary>>}}}.
|
||||||
|
|
||||||
attach_deadline(undefined, Context) ->
|
|
||||||
Context;
|
|
||||||
attach_deadline(Deadline, Context) ->
|
|
||||||
woody_context:set_deadline(Deadline, Context).
|
|
||||||
|
Loading…
Reference in New Issue
Block a user