Skip to content

Commit

Permalink
fix upload queue
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-shashank committed Jun 5, 2024
1 parent 52f6df4 commit 63add40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ansible/archival-snapshots/resources/diff_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -euxo pipefail

FOREST=/mnt/md0/exported/archival/forest-v0.17.2/forest-tool
UPLOADED_DIFFS=/mnt/md0/exported/archival/uploaded-diff-snaps.txt
UPLOAD_QUEUE="/mnt/md0/exported/archival/upload_files.txt"

EPOCH_START="$1"
shift
Expand All @@ -13,7 +14,10 @@ GENESIS_TIMESTAMP=1598306400
SECONDS_PER_EPOCH=30

# Clear Upload List
rm /mnt/md0/exported/archival/upload_files.txt
if [ -f "$UPLOAD_QUEUE" ]; then
# Clear the contents of the file
> "$UPLOAD_QUEUE"
fi

aws --profile prod --endpoint "$ENDPOINT" s3 ls "s3://forest-archive/mainnet/diff/" > "$UPLOADED_DIFFS"

Expand All @@ -29,7 +33,7 @@ for i in $(seq 1 $DIFF_COUNT); do
"$FOREST" archive export --depth "$DIFF_STEP" --epoch "$EPOCH" --diff $((EPOCH-DIFF_STEP)) --diff-depth 900 --output-path "$FILE" "$@"
fi
# Add exported diff snapshot to upload queue
echo "$FILE" >> /mnt/md0/exported/archival/upload_files.txt
echo "$FILE" >> "$UPLOAD_QUEUE"
else
echo "Skipping $FILE"
fi
Expand Down

0 comments on commit 63add40

Please sign in to comment.