From c029ba59be3c1934a54e874a4b3e33e4ff89ea42 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 3 May 2019 08:36:05 +0200 Subject: bin/get-assignment: order by "was built the least times" instead of "was built the longest time ago" (4th "digit") --- bin/get-assignment | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/get-assignment') diff --git a/bin/get-assignment b/bin/get-assignment index 4b95775..f6491fc 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -203,7 +203,7 @@ done # 1: we requested it # 2: tool chain priority # 3: its priority -# 4: was built the longest time ago +# 4: was built the least times # 5: architecture matches # 6: is part of a loop # 7: has the oldes package source @@ -374,7 +374,7 @@ next_building=$( printf ' LEFT JOIN (' printf 'SELECT' printf ' `failed_builds`.`build_assignment`,' - printf 'MAX(`failed_builds`.`date`) AS `date`' + printf 'COUNT(DISTINCT `failed_builds`.`id`) AS `count`' printf ' FROM `failed_builds`' printf ' GROUP BY `failed_builds`.`build_assignment`' printf ') AS `latest_failed_builds`' @@ -464,7 +464,7 @@ next_building=$( # 2: not in toolchain printf 'IFNULL(`toolchain_query`.`priority`,2),' printf '`build_assignments`.`priority` DESC,' - printf 'IFNULL(`latest_failed_builds`.`date`,0),' + printf 'IFNULL(`latest_failed_builds`.`count`,0),' printf 'IF(`architectures`.`id`=`build_assignments`.`architecture`,1,0) DESC,' printf 'IF(' mysql_query_is_part_of_loop '`build_assignments`.`id`' -- cgit v1.2.3