Browse Source

Double the number of attempts on initial bucket creation

master
JustAnotherArchivist 3 weeks ago
parent
commit
1259d81a52
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      ia-upload-stream

+ 2
- 2
ia-upload-stream View File

@@ -261,8 +261,8 @@ def upload(item, filename, metadata, *, iaConfigFile = None, partSize = 100*1024
logger.info(f'Got upload ID {uploadId}')

# Wait for the item to exist; if the above created the item, it takes a little while for IA to actually create the bucket, and uploads would fail with a 404 until then.
# Use twice the normal amount of retries because it frequently breaks...
for attempt in range(1, 2 * tries + 1):
# Use four times the normal amount of retries because it frequently breaks...
for attempt in range(1, 4 * tries + 1):
logger.info(f'Checking for existence of {item}')
r = requests.get(f'https://s3.us.archive.org/{item}/', headers = headers, timeout = TIMEOUT)
if r.status_code == 200:


Loading…
Cancel
Save