Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-03-22 17:31:07 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-03-23 23:47:00 +0300
commit3e1bd5570f0ca277fb82a45d83f5bf44f3663a0d (patch)
tree50c19275e482f22cd8b6fdcbe904c8c74e5e5e8f /scripts/utils.sh
parent435468af380d0200c5b133f1c0263daf2c8a7783 (diff)
Test both PostgreSQL and MySQL for the win.
Diffstat (limited to 'scripts/utils.sh')
-rw-r--r--scripts/utils.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/utils.sh b/scripts/utils.sh
new file mode 100644
index 00000000000..6faa701f0ce
--- /dev/null
+++ b/scripts/utils.sh
@@ -0,0 +1,14 @@
+retry() {
+ if eval "$@"; then
+ return 0
+ fi
+
+ for i in 2 1; do
+ sleep 3s
+ echo "Retrying $i..."
+ if eval "$@"; then
+ return 0
+ fi
+ done
+ return 1
+}