Skip to content

Commit 74f13e6

Browse files
EbonsignoriCopilotheiskr
authored
fetch build time translation repos async (#56186)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
1 parent 47781d2 commit 74f13e6

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

src/deployments/production/build-scripts/fetch-repos.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,29 @@ echo "Merging early access..."
3333
mkdir -p translations
3434
cd translations
3535

36-
# Iterate over each language
37-
echo "Fetching translations..."
38-
for lang in "es-es" "ja-jp" "pt-br" "zh-cn" "ru-ru" "fr-fr" "ko-kr" "de-de"
39-
do
40-
translations_repo="docs-internal.$lang"
41-
clone_or_use_cached_repo "$lang" "$translations_repo" "main"
36+
# Temporarily turn off exit-on-error so we can collect all PIDs
37+
set +e
38+
39+
pids=""
40+
for lang in es-es ja-jp pt-br zh-cn ru-ru fr-fr ko-kr de-de; do
41+
clone_or_use_cached_repo "$lang" "docs-internal.$lang" "main" &
42+
pids="$pids $!"
43+
done
44+
45+
failures=0
46+
for pid in $pids; do
47+
wait "$pid" || failures=$((failures+1))
4248
done
43-
echo "Done fetching translations."
49+
50+
# Restore strict mode
51+
set -e
52+
53+
if [ "$failures" -gt 0 ]; then
54+
echo "⚠️ $failures translation repo(s) failed to fetch."
55+
exit 1
56+
else
57+
echo "✅ All translations fetched."
58+
fi
4459

4560
# Go back to the root of the docs-internal repo
4661
cd ..

0 commit comments

Comments
 (0)