Skip to content

Commit facbc2b

Browse files
authored
Merge pull request #34 from AndrewHogg/andrew/timeout
Issue-28 : allowing a configurable timeout within the script, default…
2 parents 15b4080 + 5f49876 commit facbc2b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

collect_node_diag.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function usage() {
2727
echo " -v - verbose output"
2828
echo " -z - don't execute commands that require sudo"
2929
echo " -P path - top directory of COSS, DDAC or DSE installation (for tarball installs)"
30+
echo " -e timeout - e.g. \"-e 600\" allow for a longer timeout on operations"
3031
}
3132

3233
#echo "Got args $*"
@@ -67,12 +68,13 @@ MODE="normal"
6768
NOSUDO=""
6869
JMX_OPTS=""
6970
ROOT_DIR=""
71+
TIMEOUT="120"
7072

7173
# ---------------
7274
# Parse arguments
7375
# ---------------
7476

75-
while getopts ":hzivkn:c:p:f:d:o:t:I:m:P:" opt; do
77+
while getopts ":hzivkne:c:p:f:d:o:t:I:m:P:" opt; do
7678
case $opt in
7779
n) NT_OPTS="$OPTARG"
7880
;;
@@ -107,6 +109,8 @@ while getopts ":hzivkn:c:p:f:d:o:t:I:m:P:" opt; do
107109
;;
108110
P) ROOT_DIR="$OPTARG"
109111
;;
112+
e) TIMEOUT="$OPTARG"
113+
;;
110114
h) usage
111115
exit 0
112116
;;
@@ -132,7 +136,7 @@ fi
132136

133137
MAYBE_RUN_WITH_TIMEOUT=""
134138
if [ -n "$(command -v timeout)" ]; then
135-
MAYBE_RUN_WITH_TIMEOUT="timeout --foreground 120"
139+
MAYBE_RUN_WITH_TIMEOUT="timeout --foreground $TIMEOUT"
136140
fi
137141

138142
function debug {

0 commit comments

Comments
 (0)