extend wait time and cleanup messaging

pull/800/head
Scott Black 2019-08-23 11:09:26 -06:00
rodzic 970c7ece20
commit b068f8d9c1
1 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -74,10 +74,11 @@ class Hydroshare(ContentProvider):
conn = urlopen(bag_url)
while conn.info().get_content_type() != "application/zip":
if conn.getcode() != 200:
yield "Failed to download bag. status code {}".format(conn.getcode())
yield "Failed to download bag. status code {}.\n".format(conn.getcode())
return
yield "Bag is being prepared, requesting again in 3 seconds"
time.sleep(3)
wait_time = 10
yield "Bag is being prepared, requesting again in {} seconds.\n".format(wait_time)
time.sleep(wait_time)
conn = urlopen(bag_url)
filehandle, _ = urlretrieve(bag_url)