Skip to content

Commit 0358ce2

Browse files
committed
only collect metrics on the first build attempt
1 parent 36845cf commit 0358ce2

5 files changed

+104
-44
lines changed

.sqlx/query-43d0bb3b88356af3abdae506b7699ec762a6f1debbbda49a3479fddaa8917e17.json renamed to .sqlx/query-4242ea977833de52a1b11e1bf418750e53a36222d36ab26140a7692e200fd35b.json

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-ebb47544b1090567139f3bdf2c22993c3a3aaef41c6520095a2c3bfaf6035da6.json renamed to .sqlx/query-9633480047fdf3519d16bc5b4035b2e2d0e4403aa54c5cefbd64188ba3b41132.json

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bin/cratesfyi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ impl BuildSubcommand {
469469
.as_ref()
470470
.map(|s| PackageKind::Registry(s.as_str()))
471471
.unwrap_or(PackageKind::CratesIo),
472+
true,
472473
)
473474
.context("Building documentation failed")?;
474475
}

src/build_queue.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pub(crate) struct QueuedCrate {
2929
pub(crate) version: String,
3030
pub(crate) priority: i32,
3131
pub(crate) registry: Option<String>,
32+
pub(crate) attempt: i32,
3233
}
3334

3435
#[derive(Debug)]
@@ -165,7 +166,7 @@ impl AsyncBuildQueue {
165166

166167
Ok(sqlx::query_as!(
167168
QueuedCrate,
168-
"SELECT id, name, version, priority, registry
169+
"SELECT id, name, version, priority, registry, attempt
169170
FROM queue
170171
WHERE attempt < $1
171172
ORDER BY priority ASC, attempt ASC, id ASC",
@@ -495,7 +496,7 @@ impl BuildQueue {
495496
let to_process = match self.runtime.block_on(
496497
sqlx::query_as!(
497498
QueuedCrate,
498-
"SELECT id, name, version, priority, registry
499+
"SELECT id, name, version, priority, registry, attempt
499500
FROM queue
500501
WHERE
501502
attempt < $1 AND
@@ -646,7 +647,7 @@ impl BuildQueue {
646647
return Err(err);
647648
}
648649

649-
builder.build_package(&krate.name, &krate.version, kind)
650+
builder.build_package(&krate.name, &krate.version, kind, krate.attempt == 0)
650651
})?;
651652

652653
Ok(processed)

0 commit comments

Comments
 (0)