add the retry function
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 5m46s

This commit is contained in:
Pierre Geeraert
2025-12-04 17:00:48 +00:00
parent e614d50f9c
commit 99f05a055d
+20 -1
View File
@@ -116,10 +116,29 @@ def images_downloader(name,images_url_list,destination_named_folder):
opener = urlrequest.build_opener(proxy)
urlrequest.install_opener(opener)
urlrequest.urlretrieve(image_url, filename )
try:
urlrequest.urlretrieve(image_url, filename )
except:
print("Can't download "+filename+" -- "+image_url)
individual_image_downloader.delay(image_url=image_url, filename=filename)
return 0
@shared_task()
def individual_image_downloader(image_url, filename ):
print("Downloading again: "+filename+" -- "+image_url)
opener = urlrequest.build_opener(proxy)
urlrequest.install_opener(opener)
try:
urlrequest.urlretrieve(image_url, filename )
except:
print("Still Can't download "+filename+" -- "+image_url+" == Cancelling")
return 0
def incremental(request):
return render(request, 'incremental_form.html',{})