We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a309cc commit fa14690Copy full SHA for fa14690
wait-for
@@ -32,7 +32,8 @@ USAGE
32
33
wait_for() {
34
for i in `seq $TIMEOUT` ; do
35
- nc -z "$HOST" "$PORT" > /dev/null 2>&1
+ # use a 1-second timeout, but still sleep 0.1 seconds after just to be safe
36
+ nc -w 1 -z "$HOST" "$PORT" > /dev/null 2>&1
37
38
result=$?
39
if [ $result -eq 0 ] ; then
@@ -41,7 +42,7 @@ wait_for() {
41
42
fi
43
exit 0
44
- sleep 1
45
+ sleep 0.1
46
done
47
echo "Operation timed out" >&2
48
if [ $result -ne 0 ] && [ $STRICT -ne 1 ] ; then
0 commit comments