aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/datastore
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-01-12 14:55:30 +0000
committerChristopher Baines <mail@cbaines.net>2024-01-12 14:55:30 +0000
commitd6edfc8f8f474ccb1c200f2135384646f11c8fb5 (patch)
tree77b2ab1247ce0b346f3fcb799096c70cce14a1b0 /guix-build-coordinator/datastore
parentf2d4f61b0b36f3a0c23e6eeef60085e7e27a543f (diff)
downloadbuild-coordinator-d6edfc8f8f474ccb1c200f2135384646f11c8fb5.tar
build-coordinator-d6edfc8f8f474ccb1c200f2135384646f11c8fb5.tar.gz
Add more options when updating build priorities
Computing new derived priorities is slow, so these options allow skipping that if you know what you're doing. For example, if you're updating a batch of related builds and you want them all to have the same priorities and derived priorities, you can now do that much quicker.
Diffstat (limited to 'guix-build-coordinator/datastore')
-rw-r--r--guix-build-coordinator/datastore/sqlite.scm14
1 files changed, 8 insertions, 6 deletions
diff --git a/guix-build-coordinator/datastore/sqlite.scm b/guix-build-coordinator/datastore/sqlite.scm
index 888775e..f10af88 100644
--- a/guix-build-coordinator/datastore/sqlite.scm
+++ b/guix-build-coordinator/datastore/sqlite.scm
@@ -1638,7 +1638,8 @@ WHERE build_id = :build_id"
(apply
(lambda* (uuid new-priority
- #:key skip-updating-other-build-derived-priorities)
+ #:key skip-updating-derived-priorities?
+ override-derived-priority)
(let ((build-id
old-priority
(call-with-worker-thread
@@ -1664,8 +1665,9 @@ WHERE build_id = :build_id"
db
build-id))
(new-derived-priority
- (max new-priority
- (get-derived-priority db build-id))))
+ (or override-derived-priority
+ (max new-priority
+ (get-derived-priority db build-id)))))
(unless (eq? old-derived-priority
new-derived-priority)
@@ -1674,7 +1676,7 @@ WHERE build_id = :build_id"
new-derived-priority))
(unless (or all-inputs-built?
- skip-updating-other-build-derived-priorities)
+ skip-updating-derived-priorities?)
(when (> new-derived-priority
old-derived-priority)
(update-unprocessed-builds-with-higher-derived-priorities
@@ -1687,8 +1689,8 @@ WHERE build_id = :build_id"
;; transaction, but since there could be lots of builds to update the
;; priority of, and a new derived priority has to be calculated for
;; each one, it's better to handle it afterwards.
- (when (< new-priority
- old-priority)
+ (when (and (not skip-updating-derived-priorities?)
+ (< new-priority old-priority))
(datastore-update-unprocessed-builds-with-lower-derived-priorities
datastore
uuid