fix: add http timeout to prevent hanging

This commit is contained in:
Thales Macedo Garitezi 2022-03-18 10:22:21 -03:00
parent bf82b2d45c
commit 7ec6947c02
No known key found for this signature in database
GPG Key ID: DD279F8152A9B6DD
1 changed files with 3 additions and 1 deletions

View File

@ -314,7 +314,9 @@ report_telemetry(State = #state{url = URL}) ->
end.
httpc_request(Method, URL, Headers, Body) ->
httpc:request(Method, {URL, Headers, "application/json", Body}, [], []).
HTTPOptions = [{timeout, 10_000}],
Options = [],
httpc:request(Method, {URL, Headers, "application/json", Body}, HTTPOptions, Options).
parse_os_release(FileContent) ->
lists:foldl(fun(Line, Acc) ->