File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -98,23 +98,28 @@ unzip -o $zipUrl1 -d infra/data/"$extractedFolder1"
9898echo " Uploading files to Azure Blob Storage"
9999az storage blob upload-batch --account-name " $storageAccount " --destination " $fileSystem " /" $extractedFolder1 " --source infra/data/" $extractedFolder1 " --auth-mode login --pattern ' *' --overwrite --output none
100100if [ $? -ne 0 ]; then
101- retries=3
101+ maxRetries=5
102+ retries=$maxRetries
102103 sleepTime=10
103- echo " Error: Failed to upload files to Azure Blob Storage. Retrying upload...( $(( 4 - retries )) of 3) "
104+ attempt=1
104105 while [ $retries -gt 0 ]; do
106+ echo " Error: Failed to upload files to Azure Blob Storage. Retrying upload...$attempt of $maxRetries in $sleepTime seconds"
105107 sleep $sleepTime
106108 az storage blob upload-batch --account-name " $storageAccount " --destination " $fileSystem " /" $extractedFolder1 " --source infra/data/" $extractedFolder1 " --auth-mode login --pattern ' *' --overwrite --output none
107109 if [ $? -eq 0 ]; then
108110 echo " Files uploaded successfully to Azure Blob Storage."
109111 break
110112 else
111113 (( retries-- ))
112- echo " Retrying upload... ( $(( 4 - retries )) of 3) "
114+ (( attempt ++ ))
113115 sleepTime=$(( sleepTime * 2 ))
114- sleep $sleepTime
115116 fi
116117 done
117- exit 1
118+
119+ if [ $retries -eq 0 ]; then
120+ echo " Error: Failed to upload files after all retry attempts."
121+ exit 1
122+ fi
118123else
119124 echo " Files uploaded successfully to Azure Blob Storage."
120125fi
You can’t perform that action at this time.
0 commit comments