feat(webhook): use clientid for hash-loadbalancing ehttpc workers

This commit is contained in:
Thales Macedo Garitezi 2023-05-12 13:32:13 -03:00
parent 02c8894dd3
commit 01cf7fc703
1 changed files with 4 additions and 2 deletions

View File

@ -268,9 +268,10 @@ on_query(InstId, {send_message, Msg}, State) ->
} = process_request(Request, Msg), } = process_request(Request, Msg),
%% bridge buffer worker has retry, do not let ehttpc retry %% bridge buffer worker has retry, do not let ehttpc retry
Retry = 0, Retry = 0,
ClientId = maps:get(clientid, Msg, undefined),
on_query( on_query(
InstId, InstId,
{undefined, Method, {Path, Headers, Body}, Timeout, Retry}, {ClientId, Method, {Path, Headers, Body}, Timeout, Retry},
State State
) )
end; end;
@ -370,9 +371,10 @@ on_query_async(InstId, {send_message, Msg}, ReplyFunAndArgs, State) ->
headers := Headers, headers := Headers,
request_timeout := Timeout request_timeout := Timeout
} = process_request(Request, Msg), } = process_request(Request, Msg),
ClientId = maps:get(clientid, Msg, undefined),
on_query_async( on_query_async(
InstId, InstId,
{undefined, Method, {Path, Headers, Body}, Timeout}, {ClientId, Method, {Path, Headers, Body}, Timeout},
ReplyFunAndArgs, ReplyFunAndArgs,
State State
) )