From fe75af7a3ff04e0327aa0425f9f6d6cae0925b1b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 18 Jun 2023 21:57:50 +0200 Subject: bin/get-assignment: take max priority of _considered_ build_assignments --- bin/get-assignment | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/bin/get-assignment b/bin/get-assignment index 37b430f..8b399a3 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -221,11 +221,6 @@ next_building=$( printf ');\n' done - printf 'SET @`max_priority`=(' - printf 'SELECT MAX(`build_assignments`.`priority`)' - printf ' FROM `build_assignments`' - printf ');\n' - printf 'INSERT IGNORE INTO `considered_build_assignments` (`id`)' printf ' SELECT `build_assignments`.`id`' printf ' FROM `build_assignments`' @@ -247,8 +242,7 @@ next_building=$( printf ')' printf ' LEFT' mysql_join_package_sources_toolchain_order - printf ' WHERE `build_assignments`.`priority`=@`max_priority`' - printf ' AND (' + printf ' WHERE (' printf '`build_assignments`.`is_blocked` IS NULL' if [ -n "${requested}" ]; then printf ' OR' @@ -266,6 +260,21 @@ next_building=$( printf ' AND `architectures`.`name` = from_base64("%s");\n' \ "${arch}" + printf 'SET @`max_priority`=(' + printf 'SELECT MAX(`build_assignments`.`priority`)' + printf ' FROM `considered_build_assignments`' + printf ' JOIN `build_assignments`' + printf ' ON `build_assignments`.`id`=`considered_build_assignments`.`id`' + printf ');\n' + + printf 'DELETE `considered_build_assignments`' + printf ' FROM `considered_build_assignments`' + printf ' JOIN `build_assignments`' + printf ' ON `build_assignments`.`id`=`considered_build_assignments`.`id`' + printf ' WHERE `build_assignments`.`priority`<@`max_priority`' + printf ';\n' + + printf 'INSERT IGNORE INTO `considered_build_assignments_2` (`id`)' printf ' SELECT `considered_build_assignments`.`id`' printf ' FROM `considered_build_assignments`;\n' -- cgit v1.2.3-70-g09d2