From b938abdea1480496fa5b402783539b16bbfb86d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 9 Jan 2021 10:21:11 +0200 Subject: [PATCH] rehash: preserve existing $PYENV_REHASH_TIMEOUT semantics Try for that long no matter what the sleep step available is. --- libexec/pyenv-rehash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/pyenv-rehash b/libexec/pyenv-rehash index 33b7e233..4e31994e 100755 --- a/libexec/pyenv-rehash +++ b/libexec/pyenv-rehash @@ -40,7 +40,8 @@ if [ ! -w "$SHIM_PATH" ]; then fi unset acquired -for (( i=1; i<="${PYENV_REHASH_TIMEOUT:-60}"; i++ )); do +start=$SECONDS +while (( SECONDS <= start + ${PYENV_REHASH_TIMEOUT:-60} )); do if acquire_lock 2>/dev/null; then acquired=1 break