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

Dont download S3 snap if honor_quick_sync is false #860

Merged
merged 3 commits into from
Jun 11, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/blockchain_worker.erl
Expand Up @@ -912,9 +912,15 @@ grab_snapshot(Height, Hash) ->
start_snapshot_sync(Hash, Height, Swarm, Chain, Peer) ->
spawn_monitor(fun() ->
try
case application:get_env(blockchain, s3_base_url, undefined) of
undefined -> throw({error, no_s3_base_url});
BaseUrl ->
BaseUrl = application:get_env(blockchain, s3_base_url, undefined),
HonorQS = application:get_env(blockchain, honor_quick_sync, true),

case {HonorQS, BaseUrl} of
{_, undefined} -> throw({error, no_s3_base_url});
{false, _} ->
evanmcc marked this conversation as resolved.
Show resolved Hide resolved
%% honor_quick_sync is false, don't download from S3
ok;
{true, BaseUrl} ->
%% we are looking up the configured blessed
%% height again because the height passed
%% into this function has sometimes been
Expand Down