1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 21:55:08 +00:00

Fix perl timeout fallback selection

This commit is contained in:
Tw93
2026-03-07 20:30:06 +08:00
parent dfedc029d1
commit faf29b05f1
3 changed files with 4 additions and 2 deletions

View File

@@ -42,9 +42,9 @@ if [[ -z "${MO_TIMEOUT_INITIALIZED:-}" ]]; then
fi fi
done done
if [[ -z "$MO_TIMEOUT_BIN" ]] && command -v perl > /dev/null 2>&1; then if command -v perl > /dev/null 2>&1; then
MO_TIMEOUT_PERL_BIN="$(command -v perl)" MO_TIMEOUT_PERL_BIN="$(command -v perl)"
if [[ "${MO_DEBUG:-0}" == "1" ]]; then if [[ -z "$MO_TIMEOUT_BIN" ]] && [[ "${MO_DEBUG:-0}" == "1" ]]; then
echo "[TIMEOUT] Using perl fallback: $MO_TIMEOUT_PERL_BIN" >&2 echo "[TIMEOUT] Using perl fallback: $MO_TIMEOUT_PERL_BIN" >&2
fi fi
fi fi

View File

@@ -252,6 +252,7 @@ set -euo pipefail
source "$PROJECT_ROOT/lib/core/common.sh" source "$PROJECT_ROOT/lib/core/common.sh"
source "$PROJECT_ROOT/lib/clean/caches.sh" source "$PROJECT_ROOT/lib/clean/caches.sh"
MO_TIMEOUT_BIN="" MO_TIMEOUT_BIN=""
MO_TIMEOUT_PERL_BIN="${MO_TIMEOUT_PERL_BIN:-$(command -v perl)}"
export MOLE_PROJECT_CACHE_DISCOVERY_TIMEOUT=0.5 export MOLE_PROJECT_CACHE_DISCOVERY_TIMEOUT=0.5
export MOLE_PROJECT_CACHE_SCAN_TIMEOUT=0.5 export MOLE_PROJECT_CACHE_SCAN_TIMEOUT=0.5
SECONDS=0 SECONDS=0

View File

@@ -114,6 +114,7 @@ EOF
set -euo pipefail set -euo pipefail
source "$PROJECT_ROOT/lib/core/timeout.sh" source "$PROJECT_ROOT/lib/core/timeout.sh"
MO_TIMEOUT_BIN="" MO_TIMEOUT_BIN=""
MO_TIMEOUT_PERL_BIN="${MO_TIMEOUT_PERL_BIN:-$(command -v perl)}"
SECONDS=0 SECONDS=0
set +e set +e
run_with_timeout 1 "$FAKE_CMD" run_with_timeout 1 "$FAKE_CMD"