Skip to content

Commit

Permalink
scripts: continious_upload: retry if upload failed
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Mar 21, 2023
1 parent cc6838e commit f8cf2c8
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions scripts/continious_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,21 @@ urlencode() {
for FILE in "$@" ; do
FULLNAME="${FILE}"
BASENAME="$(basename "${FILE}")"
curl -H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$FULLNAME" \
"$upload_url?name=$(urlencode "$BASENAME")"
echo ""

for retries in {1..10}; do
echo "Upload attempt $retries"

if curl -H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$FULLNAME" \
"$upload_url?name=$(urlencode "$BASENAME")"; then
break
fi

sleep 1m # try to avoid ratelimits???
echo ""
done
done

$shatool "$@"
Expand Down

0 comments on commit f8cf2c8

Please sign in to comment.