Skip to content

Commit 01afbf8

Browse files
committed
[data] Each curl process will retry the chunk up to 3 times
1 parent de1255a commit 01afbf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libpostal_data

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ kill_background_processes() {
5151
trap kill_background_processes INT
5252

5353
PART_MSG='echo "Downloading part $1: filename=$5, offset=$2, max=$3"'
54-
PART_CURL='curl $4 --silent -H"Range:bytes=$2-$3" -o $5'
54+
PART_CURL='curl $4 --silent -H"Range:bytes=$2-$3" --retry 3 --retry-delay 2 -o $5'
5555
DOWNLOAD_PART="$PART_MSG;$PART_CURL"
5656

5757

@@ -112,7 +112,7 @@ download_file() {
112112
if [ $content_length -ge $LARGE_FILE_SIZE ]; then
113113
download_multipart $url $local_path $content_length
114114
else
115-
curl $url -o $local_path
115+
curl $url --retry 3 --retry-delay 2 -o $local_path
116116
fi
117117

118118
if date -ur . >/dev/null 2>&1; then

0 commit comments

Comments
 (0)