summaryrefslogtreecommitdiffstats
path: root/.travis/utils.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 11:49:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 12:42:05 +0000
commit2e85f9325a797977eea9dfea0a925775ddd211d9 (patch)
tree452c7f30d62fca5755f659b99e4e53c7b03afc21 /.travis/utils.sh
parentReleasing debian version 1.19.0-4. (diff)
downloadnetdata-2e85f9325a797977eea9dfea0a925775ddd211d9.tar.xz
netdata-2e85f9325a797977eea9dfea0a925775ddd211d9.zip
Merging upstream version 1.29.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.travis/utils.sh')
-rw-r--r--.travis/utils.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/.travis/utils.sh b/.travis/utils.sh
new file mode 100644
index 000000000..d084a7aef
--- /dev/null
+++ b/.travis/utils.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+# Prevent travis from timing out after 10 minutes of no output
+tick() {
+ (while true; do sleep 300; echo; done) &
+ local PID=$!
+ disown
+
+ "$@"
+ local RET=$?
+
+ kill $PID
+ return $RET
+}
+export -f tick
+
+retry() {
+ local tries=$1
+ shift
+
+ local i=0
+ while [ "$i" -lt "$tries" ]; do
+ "$@" && return 0
+ sleep $((2**((i++))))
+ done
+
+ return 1
+}
+export -f retry