aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-05-18 11:25:14 +0100
committerChristopher Baines <mail@cbaines.net>2023-05-18 11:25:14 +0100
commit4208b5f1480b7f89db0a829f3536c6db2798f2f5 (patch)
treeec9c96505095163a959a6ff1147232c9eb0480a9
parent61f66193138322f724fc91ba2e89165574b26009 (diff)
downloaddata-service-4208b5f1480b7f89db0a829f3536c6db2798f2f5.tar
data-service-4208b5f1480b7f89db0a829f3536c6db2798f2f5.tar.gz
Ignore canceled builds when querying package derivations
This will help when using this to submit builds, since you won't end up ignoring derivations with canceled builds.
-rw-r--r--guix-data-service/model/derivation.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm
index 9f9a3fb..693f11a 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -473,8 +473,11 @@ ORDER BY derivations.file_name
EXISTS(
SELECT 1
FROM builds
+ INNER JOIN latest_build_status
+ ON builds.id = latest_build_status.build_id
WHERE builds.derivation_output_details_set_id =
derivations_by_output_details_set.derivation_output_details_set_id
+ AND latest_build_status != 'canceled'
AND builds.build_server_id = " (number->string build-server-id) "
)"))
(or build-from-build-servers '()))
@@ -485,8 +488,11 @@ EXISTS(
NOT EXISTS(
SELECT 1
FROM builds
+ INNER JOIN latest_build_status
+ ON builds.id = latest_build_status.build_id
WHERE builds.derivation_output_details_set_id =
derivations_by_output_details_set.derivation_output_details_set_id
+ AND latest_build_status != 'canceled'
AND builds.build_server_id = " (number->string build-server-id) "
)"))
(or no-build-from-build-servers '()))