Skip to content

Commit 7a9aa80

Browse files
committed
Use cached master branch commits in missing_commits used by status_page, next_commit and metrics
1 parent 26e9330 commit 7a9aa80

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

site/src/load.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,9 @@ impl SiteCtxt {
208208
/// Returns the not yet tested commits
209209
pub async fn missing_commits(&self) -> Vec<(Commit, MissingReason)> {
210210
let conn = self.conn().await;
211-
let (master_commits, queued_pr_commits, in_progress_artifacts) = futures::join!(
212-
collector::master_commits(),
213-
conn.queued_commits(),
214-
conn.in_progress_artifacts()
215-
);
216-
let master_commits = master_commits
217-
.map_err(|e| anyhow::anyhow!("{:?}", e))
218-
.context("getting master commit list")
219-
.unwrap();
211+
let (queued_pr_commits, in_progress_artifacts) =
212+
futures::join!(conn.queued_commits(), conn.in_progress_artifacts());
213+
let master_commits = &self.master_commits.load().commits;
220214

221215
let index = self.index.load();
222216
let all_commits = index
@@ -226,14 +220,14 @@ impl SiteCtxt {
226220
.collect::<HashSet<_>>();
227221

228222
calculate_missing(
229-
master_commits,
223+
master_commits.clone(),
230224
queued_pr_commits,
231225
in_progress_artifacts,
232226
all_commits,
233227
)
234228
}
235229

236-
/// Get cached master-branch Rust commits.
230+
/// Get cached master-branch Rust commits.
237231
/// Returns cached results immediately, but if the cached value is older than one minute,
238232
/// updates in a background task for next time.
239233
pub fn get_master_commits(&self) -> Guard<Arc<MasterCommitCache>> {

0 commit comments

Comments
 (0)