Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

sleep for 0.1s instead of 1s in the wait_for_status loop #993

Merged
merged 1 commit into from
Jun 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion weave
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@ command_exists() {
command -v $1 >/dev/null 2>&1
}

fractional_sleep() {
case $1 in
*.*)
if [ -z "$NO_FRACTIONAL_SLEEP" ] ; then
sleep $1 >/dev/null 2>&1 && return 0
NO_FRACTIONAL_SLEEP=1
fi
sleep $((${1%.*} + 1))
;;
*)
sleep $1
;;
esac
}

run_iptables() {
# -w is recent addition to iptables
if [ -z "$CHECKED_IPTABLES_W" ] ; then
Expand Down Expand Up @@ -585,7 +600,7 @@ wait_for_status() {
echo "$err_msg" >&2
return 1
fi
sleep 1
fractional_sleep 0.1
done
}

Expand Down