aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJauhien Piatlicki (jauhien) <piatlicki@gmail.com>2013-08-14 15:33:26 +0200
committerJauhien Piatlicki (jauhien) <piatlicki@gmail.com>2013-08-14 15:33:26 +0200
commit0c6eb9864124cee25a5ba407ad01d0bb930b4701 (patch)
treef50dbfe9de6aac0c19b7ee98897ac6029ef9140e
parentmerging pypi branch (diff)
downloadg-sorcery-0c6eb9864124cee25a5ba407ad01d0bb930b4701.tar.gz
g-sorcery-0c6eb9864124cee25a5ba407ad01d0bb930b4701.tar.bz2
g-sorcery-0c6eb9864124cee25a5ba407ad01d0bb930b4701.zip
gs_pypi/pypi_db: restrict number of attempts to download package page
-rw-r--r--gs_pypi/pypi_db.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gs_pypi/pypi_db.py b/gs_pypi/pypi_db.py
index 69ad476..07fc3bc 100644
--- a/gs_pypi/pypi_db.py
+++ b/gs_pypi/pypi_db.py
@@ -54,13 +54,16 @@ class PypiDBGenerator(DBGenerator):
pkg_uries = self.decode_download_uries(pkg_uries)
for uri in pkg_uries:
+ attempts = 0
while True:
try:
+ attempts += 1
self.process_uri(uri, data)
except DownloadingError as error:
print(str(error))
- time.sleep(2)
- continue
+ time.sleep(5)
+ if attempts < 100:
+ continue
break
return data