From d16cb8b53d07c505829b9505315e1e895eb8efbe Mon Sep 17 00:00:00 2001 From: Vincent Koc <25068+vincentkoc@users.noreply.github.com> Date: Thu, 25 Jun 2026 19:06:28 +0800 Subject: [PATCH] fix(ci): keep docs translation debounce alive --- .github/workflows/translate-all.yml | 17 ++++++++++++++++- .github/workflows/translate-incremental.yml | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/translate-all.yml b/.github/workflows/translate-all.yml index c6d05077b9..90dfd1c69c 100644 --- a/.github/workflows/translate-all.yml +++ b/.github/workflows/translate-all.yml @@ -113,6 +113,21 @@ jobs: fi } + sleep_with_heartbeat() { + remaining="$1" + while [ "${remaining}" -gt 0 ]; do + chunk="${remaining}" + if [ "${chunk}" -gt 60 ]; then + chunk="60" + fi + sleep "${chunk}" + remaining=$((remaining - chunk)) + if [ "${remaining}" -gt 0 ]; then + echo "Still debouncing docs main; ${remaining}s remaining." + fi + done + } + elapsed=0 while :; do read_main_state @@ -124,7 +139,7 @@ jobs: fi echo "Waiting ${cooldown}s for docs main to settle at ${before_ref} (${before_source})." - sleep "${cooldown}" + sleep_with_heartbeat "${cooldown}" elapsed=$((elapsed + cooldown)) read_main_state diff --git a/.github/workflows/translate-incremental.yml b/.github/workflows/translate-incremental.yml index 8976ebb6c0..ebb4d9edf6 100644 --- a/.github/workflows/translate-incremental.yml +++ b/.github/workflows/translate-incremental.yml @@ -110,6 +110,21 @@ jobs: fi } + sleep_with_heartbeat() { + remaining="$1" + while [ "${remaining}" -gt 0 ]; do + chunk="${remaining}" + if [ "${chunk}" -gt 60 ]; then + chunk="60" + fi + sleep "${chunk}" + remaining=$((remaining - chunk)) + if [ "${remaining}" -gt 0 ]; then + echo "Still debouncing docs main; ${remaining}s remaining." + fi + done + } + elapsed=0 while :; do read_main_state @@ -121,7 +136,7 @@ jobs: fi echo "Waiting ${cooldown}s for docs main to settle at ${before_ref} (${before_source})." - sleep "${cooldown}" + sleep_with_heartbeat "${cooldown}" elapsed=$((elapsed + cooldown)) read_main_state