Add a 5 second delay between cache update retries

A recent change added retry behavior to DIBs git repo caching tooling.
We've since found that all of these retries can occur within just a
couple of seconds. This may not be long enough for load balancers to
notice problems with backend services and fail over so all five retries
fail in quick succession. Add a 5 second sleep between attempts to
mitigate this problem.

Change-Id: I76a10203fa9feb4a2d7d2b90231f18ec0e94a307
Signed-off-by: Clark Boylan <clark.boylan@gmail.com>
This commit is contained in:
Clark Boylan
2025-07-23 09:39:46 -07:00
parent 4987b7dbc3
commit 865e80f4b2

View File

@@ -132,6 +132,9 @@ function get_repos_for_element(){
echo "Attempt $attempt failed. Trying again..."
rm -rf $CACHE_PATH.tmp
attempt=$((attempt + 1))
if [ $attempt -le $max_attempts ] ; then
sleep 5
fi
fi
set -e
done
@@ -169,6 +172,9 @@ function get_repos_for_element(){
else
echo "Attempt $attempt failed. Trying again..."
attempt=$((attempt + 1))
if [ $attempt -le $max_attempts ] ; then
sleep 5
fi
fi
set -e
done