summaryrefslogtreecommitdiff
path: root/tsp
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2017-10-23 10:08:47 (GMT)
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-10-25 16:49:49 (GMT)
commitba657c4df4947b64caf537e36e2ff32e7e5e1281 (patch)
tree52cd51b1a6a3edce109b568e4fc7978aa66c962f /tsp
parent4c5ef1c47ab5783ba43e5f51019025df70ce9fbc (diff)
downloadmajor-ba657c4df4947b64caf537e36e2ff32e7e5e1281.zip
major-ba657c4df4947b64caf537e36e2ff32e7e5e1281.tar.gz
major-ba657c4df4947b64caf537e36e2ff32e7e5e1281.tar.bz2
Add trigger_if_not_queued to watcherrefs/changes/43/181843/1
Sometimes a lot of jobs are queued when one of them is being blocked. As it happens more often (and is disruptive for the service) no new jobs will be queued. Change-Id: If4f1db051a3e58c81ffdc777675773f1cd88b6be
Diffstat (limited to 'tsp')
-rwxr-xr-xtsp/watchers/watcher.sh23
1 files changed, 15 insertions, 8 deletions
diff --git a/tsp/watchers/watcher.sh b/tsp/watchers/watcher.sh
index b8b8977..c1fbe29 100755
--- a/tsp/watchers/watcher.sh
+++ b/tsp/watchers/watcher.sh
@@ -20,12 +20,19 @@ export TSP_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)/.."
. "${TSP_DIR}/common.sh"
+trigger_if_not_queued() {
+ LABEL="$1"
+ URL="$2"
+ test -z "$(tspoll | awk -v LABEL="$LABEL" '$2 ~ "queued" && $0 ~ LABEL {print $1}')" &&\
+ tspoll -L "$LABEL" sh "${TSP_DIR}/jobs/trigger_downloads.sh" "$URL" "$3"
+}
+
# Dispatch tsp/jobs/trigger_downloads.sh for common snapshot and prerelease urls
-tspoll -L 4_SNAPSHOT sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/snapshots/tizen/common/" tizen_4.0_snapshot
-tspoll -L 4_PRERELEASE sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/prerelease/tizen/common/" tizen_4.0_prerelease
-tspoll -L 3_SNAPSHOT sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/snapshots/tizen/3.0-common/" tizen_3.0_snapshot
-tspoll -L 3_PRERELEASE sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/prerelease/tizen/3.0-common/" tizen_3.0_prerelease
-tspoll -L UNI_SNAPSHOT sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/snapshots/tizen/unified/" tizen_uni_snapshot
-tspoll -L UNI_PRERELEASE sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/prerelease/tizen/unified/" tizen_uni_prerelease
-tspoll -L UNI4_SNAPSHOT sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/snapshots/tizen/4.0-unified/" tizen_4.0_uni_snapshot
-tspoll -L UNI4_PRERELEASE sh "${TSP_DIR}/jobs/trigger_downloads.sh" "http://download.tizen.org/prerelease/tizen/4.0-unified/" tizen_4.0_uni_prerelease
+trigger_if_not_queued 4_SNAPSHOT "http://download.tizen.org/snapshots/tizen/common/" tizen_4.0_snapshot
+trigger_if_not_queued 4_PRERELEASE "http://download.tizen.org/prerelease/tizen/common/" tizen_4.0_prerelease
+trigger_if_not_queued 3_SNAPSHOT "http://download.tizen.org/snapshots/tizen/3.0-common/" tizen_3.0_snapshot
+trigger_if_not_queued 3_PRERELEASE "http://download.tizen.org/prerelease/tizen/3.0-common/" tizen_3.0_prerelease
+trigger_if_not_queued UNI_SNAPSHOT "http://download.tizen.org/snapshots/tizen/unified/" tizen_uni_snapshot
+trigger_if_not_queued UNI_PRERELEASE "http://download.tizen.org/prerelease/tizen/unified/" tizen_uni_prerelease
+trigger_if_not_queued UNI4_SNAPSHOT "http://download.tizen.org/snapshots/tizen/4.0-unified/" tizen_4.0_uni_snapshot
+trigger_if_not_queued UNI4_PRERELEASE "http://download.tizen.org/prerelease/tizen/4.0-unified/" tizen_4.0_uni_prerelease