refactor: http cliet should not need to retry HTTP requests for bridge

This commit is contained in:
Zaiming (Stone) Shi 2023-02-01 09:30:30 +01:00
parent 6ca816f7a4
commit f4381d90ca
1 changed files with 7 additions and 4 deletions

View File

@ -264,9 +264,10 @@ on_query(InstId, {send_message, Msg}, State) ->
path := Path,
body := Body,
headers := Headers,
request_timeout := Timeout,
max_retries := Retry
request_timeout := Timeout
} = process_request(Request, Msg),
%% bridge buffer worker has retry, do not let ehttpc retry
Retry = 0,
on_query(
InstId,
{undefined, Method, {Path, Headers, Body}, Timeout, Retry},
@ -274,9 +275,11 @@ on_query(InstId, {send_message, Msg}, State) ->
)
end;
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, {undefined, Method, Request, Timeout, 2}, State);
%% TODO: Get retry from State
on_query(InstId, {undefined, Method, Request, Timeout, _Retry = 2}, State);
on_query(
InstId,
{KeyOrNum, Method, Request, Timeout, Retry},