File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ async def url_worker():
121
121
continue
122
122
if client_session is None :
123
123
client_session = ClientSession ()
124
- for _ in range (5 ): #" Up to 4 retries (5 attempts total)
124
+ for retry_num in range (5 ): #" Up to 4 retries (5 attempts total)
125
125
try :
126
126
async with client_session .get ("https://web.archive.org/save/" + next_job .url .url , allow_redirects = False ) as resp :
127
127
resp .raise_for_status ()
@@ -134,7 +134,7 @@ async def url_worker():
134
134
except Exception :
135
135
print ("Skipping exception during URL archiving:" )
136
136
print_exc ()
137
- await asyncio .sleep (30 )
137
+ await asyncio .sleep (10 * pow ( 2 , retry_num ) )
138
138
else : # Ran out of retries, try again
139
139
async with session .begin ():
140
140
if next_job .retry < 4 :
You can’t perform that action at this time.
0 commit comments