From c0551a94fd73e5184e673404e01d255be21cf2f0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 28 Jun 2019 15:17:09 +0200 Subject: bin/return-assignment: prioritize failed build_assignments iff a broken dependency was rescheduled --- bin/return-assignment | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bin/return-assignment') diff --git a/bin/return-assignment b/bin/return-assignment index 7b8507e..017b9e9 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -321,6 +321,24 @@ if [ "$6" = 'ERROR' ]; then fi ) + # prioritize _this_ build assignment iff we rescheduled any broken dependencies + if [ -n "${rescheduled_packages}" ]; then + # shellcheck disable=SC2016 + { + printf 'UPDATE `build_assignments`' + printf ' SET `build_assignments`.`priority`=(' + printf 'SELECT MAX(`build_assignments`.`priority`)' + printf ' FROM `build_assignments`' + printf ')+1' + printf ' WHERE `build_assignments`.`id`=from_base64("%s");\n' \ + "$( + printf '%s' "${build_assignment_id}" | \ + base64 -w0 + )" + } | \ + mysql_run_query + fi + # shellcheck disable=SC2119 { printf '%s/%s ' \ -- cgit v1.2.3-70-g09d2