Skip to content

Commit

Permalink
base rebuild order on last build attempt, not rustc date
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Nov 2, 2024
1 parent 2b767dc commit b536a56
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/build_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,19 +698,24 @@ pub async fn queue_rebuilds(
SELECT
c.name,
r.version,
max(b.rustc_nightly_date) as rustc_nightly_date
(
SELECT MAX(b.rustc_nightly_date)
FROM builds AS b
WHERE b.rid = r.id AND b.rustc_nightly_date IS NOT NULL
) AS rustc_nightly_date,
(
SELECT MAX(COALESCE(b.build_finished, b.build_started))
FROM builds AS b
WHERE b.rid = r.id
) AS last_build_attempt
FROM crates AS c
INNER JOIN releases AS r ON c.latest_version_id = r.id
INNER JOIN builds AS b ON r.id = b.rid
WHERE
r.rustdoc_status = TRUE
GROUP BY c.name, r.version
) as i
WHERE i.rustc_nightly_date < $1
ORDER BY i.rustc_nightly_date ASC
ORDER BY i.last_build_attempt ASC
LIMIT $2",
config
.rebuild_up_to_date
Expand Down

0 comments on commit b536a56

Please sign in to comment.