Skip to content

Commit

Permalink
#4538: fixed shell script syntax on verify range
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Aug 26, 2024
1 parent 7315813 commit d236308
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions services/horizon/docker/verify-range/start
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ sudo -u postgres createdb horizon
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"

if [ $FROM -eq 0 ] && [ $TO -eq 0 ]; then
RECENTSMALLRANGE=$(curl -s "$HISTORY_ARCHIVE_URLS/.well-known/stellar-history.json" | jq -r --exit-status 'if .currentLedger < 64 then "0;63" else "\(.currentLedger-64);\(.currentLedger)" end' | tr ";" "\n")
export FROM=${RECENTSMALLRANGE[0]}
export TO=${RECENTSMALLRANGE[1]}
CURRENTHAS=$(curl -s "$HISTORY_ARCHIVE_URLS/.well-known/stellar-history.json" | jq -r --exit-status 'if .currentLedger < 64 then "0;63" else "\(.currentLedger-64);\(.currentLedger)" end')
IFS=';' read -a RECENTSMALLRANGE <<< "$CURRENTHAS"
FROM=${RECENTSMALLRANGE[0]}
TO=${RECENTSMALLRANGE[1]}
fi

# Calculate params for AWS Batch
Expand Down

0 comments on commit d236308

Please sign in to comment.