refactor: http cliet should not need to retry HTTP requests for bridge
This commit is contained in:
parent
6ca816f7a4
commit
f4381d90ca
|
@ -264,9 +264,10 @@ on_query(InstId, {send_message, Msg}, State) ->
|
||||||
path := Path,
|
path := Path,
|
||||||
body := Body,
|
body := Body,
|
||||||
headers := Headers,
|
headers := Headers,
|
||||||
request_timeout := Timeout,
|
request_timeout := Timeout
|
||||||
max_retries := Retry
|
|
||||||
} = process_request(Request, Msg),
|
} = process_request(Request, Msg),
|
||||||
|
%% bridge buffer worker has retry, do not let ehttpc retry
|
||||||
|
Retry = 0,
|
||||||
on_query(
|
on_query(
|
||||||
InstId,
|
InstId,
|
||||||
{undefined, Method, {Path, Headers, Body}, Timeout, Retry},
|
{undefined, Method, {Path, Headers, Body}, Timeout, Retry},
|
||||||
|
@ -274,9 +275,11 @@ on_query(InstId, {send_message, Msg}, State) ->
|
||||||
)
|
)
|
||||||
end;
|
end;
|
||||||
on_query(InstId, {Method, Request}, State) ->
|
on_query(InstId, {Method, Request}, State) ->
|
||||||
on_query(InstId, {undefined, Method, Request, 5000, 2}, State);
|
%% TODO: Get retry from State
|
||||||
|
on_query(InstId, {undefined, Method, Request, 5000, _Retry = 2}, State);
|
||||||
on_query(InstId, {Method, Request, Timeout}, State) ->
|
on_query(InstId, {Method, Request, Timeout}, State) ->
|
||||||
on_query(InstId, {undefined, Method, Request, Timeout, 2}, State);
|
%% TODO: Get retry from State
|
||||||
|
on_query(InstId, {undefined, Method, Request, Timeout, _Retry = 2}, State);
|
||||||
on_query(
|
on_query(
|
||||||
InstId,
|
InstId,
|
||||||
{KeyOrNum, Method, Request, Timeout, Retry},
|
{KeyOrNum, Method, Request, Timeout, Retry},
|
||||||
|
|
Loading…
Reference in New Issue