Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1277 from helium/adt/handle-hackney-async-timeout
Browse files Browse the repository at this point in the history
Work-around that hackney doesn't send a message on timeouts when async
  • Loading branch information
Vagabond authored Mar 7, 2022
2 parents a0233a3 + 29a1aeb commit 9433396
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/blockchain_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,9 @@ do_snap_source_download(Url, Filepath) ->
{hackney_response, Ref, Bin} ->
file:write(FD, Bin),
Loop(Ref)
after 900000 ->
%% hackney doesn't seem to do anything on a timeout in async mode
throw(timeout)
end
end,
case hackney:request(get, Url, Headers ++ [{<<"range">>, list_to_binary("bytes=" ++ integer_to_list(Start) ++ "-")}], <<>>, Options) of
Expand Down

0 comments on commit 9433396

Please sign in to comment.