File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed
Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,32 @@ jobs:
3838 uses : azure/CLI@v1
3939 with :
4040 inlineScript : |
41- # List all .gz files and update their properties one by one
42- for file in $(find ./publish/wwwroot -name "*.gz"); do
41+ # Find all .gz files
42+ gz_files=$(find ./publish/wwwroot -name "*.gz")
43+
44+ # Set maximum number of parallel processes
45+ max_processes=10
46+ count=0
47+
48+ # Update properties in parallel
49+ for file in $gz_files; do
4350 relative_path=${file#./publish/wwwroot/}
4451 az storage blob update \
4552 --connection-string "${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }}" \
4653 --container-name '$web' \
4754 --name "$relative_path" \
4855 --content-encoding "gzip" \
49- --content-type "application/octet-stream"
50- done
56+ --content-type "application/octet-stream" &
57+
58+ # Increment process counter
59+ ((count++))
60+
61+ # If we've reached max_processes, wait for them to complete
62+ if [ $count -eq $max_processes ]; then
63+ wait
64+ count=0
65+ fi
66+ done
67+
68+ # Wait for any remaining processes
69+ wait
You can’t perform that action at this time.
0 commit comments