Skip to content

Commit 84eac26

Browse files
committed
Only load the last ~month of master commits
1 parent 224adee commit 84eac26

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

site/src/job_queue/mod.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ async fn create_benchmark_request_master_commits(
2626
conn: &dyn database::pool::Connection,
2727
index: &BenchmarkRequestIndex,
2828
) -> anyhow::Result<()> {
29-
let master_commits = &ctxt.get_master_commits().commits;
29+
let now = Utc::now();
30+
31+
let master_commits = ctxt.get_master_commits();
32+
// Only consider the last ~month of master commits
33+
let master_commits = master_commits
34+
.commits
35+
.iter()
36+
.filter(|c| now.signed_duration_since(c.time) < chrono::Duration::days(29));
37+
3038
// TODO; delete at some point in the future
3139
let cutoff: chrono::DateTime<Utc> = chrono::DateTime::from_str("2025-08-27T00:00:00.000Z")?;
3240

@@ -62,12 +70,11 @@ async fn create_benchmark_request_releases(
6270
// TODO; delete at some point in the future
6371
let cutoff: chrono::DateTime<Utc> = chrono::DateTime::from_str("2025-08-27T00:00:00.000Z")?;
6472

65-
let releases: Vec<_> = releases
73+
let releases = releases
6674
.lines()
6775
.rev()
6876
.filter_map(parse_release_string)
69-
.take(20)
70-
.collect();
77+
.take(20);
7178

7279
for (name, commit_date) in releases {
7380
if commit_date >= cutoff && !index.contains_tag(&name) {

0 commit comments

Comments
 (0)