Skip to content

Commit

Permalink
sleep
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Wrock <[email protected]>
  • Loading branch information
mwrock committed Dec 12, 2024
1 parent bb2e582 commit b65da43
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions components/studio/bin/hab-studio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1041,15 +1041,6 @@ chown_certs() {
}

# **Internal**
# Mimic delay using busy loop
busy_sleep() {
local duration=$1
local end_time=$(( $(date +%s) + duration ))
while [ "$(date +%s)" -lt "$end_time" ]; do
: # No-op, keeps the loop running
done
}

# **Internal** Unmount mount point if mounted and abort if an unmount is
# unsuccessful.
#
Expand Down Expand Up @@ -1082,7 +1073,8 @@ umount_fs() {
i=1
while [ "$i" -le "$MAX_RETRIES" ]
do
busy_sleep $((RETRY_DELAY * i)) # Delay increases with each retry
echo "$PATH"
sleep $((RETRY_DELAY * i)) # Delay increases with each retry
if ! is_fs_mounted "$_mount_point"; then
return 0
fi
Expand Down

0 comments on commit b65da43

Please sign in to comment.