Skip to content

Commit

Permalink
Clean up after failed curl in silo_import (#1140)
Browse files Browse the repository at this point in the history
* Clean up after failed curl in silo_import

* Update silo_import_job.sh
  • Loading branch information
theosanderson authored Feb 26, 2024
1 parent 11cb253 commit 6af07f7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kubernetes/loculus/silo_import_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,17 @@ download_data() {

released_data_endpoint="$BACKEND_BASE_URL/get-released-data"
echo "calling $released_data_endpoint"

set +e
curl -o "$data_dir/data.ndjson" --fail-with-body "$released_data_endpoint" -H "Authorization: Bearer $jwt"
exit_code=$?
set -e

if [ $exit_code -ne 0 ]; then
echo "Curl command failed with exit code $exit_code, cleaning up and exiting."
rm -rf "$data_dir"
exit $exit_code
fi

echo "downloaded $(wc -l < "$data_dir/data.ndjson") sequences"
echo
Expand Down

0 comments on commit 6af07f7

Please sign in to comment.