Skip to content

Commit 8663847

Browse files
increment TOTAL_BUILDS after a build finishes
...instead of when it's automatically queued
1 parent fbe696f commit 8663847

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/docbuilder/queue.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ impl DocBuilder {
6262
match builder.build_package(self, &name, &version) {
6363
Ok(_) => {
6464
let _ = conn.execute("DELETE FROM queue WHERE id = $1", &[&id]);
65+
::web::metrics::TOTAL_BUILDS.inc();
6566
}
6667
Err(e) => {
6768
// Increase attempt count
@@ -70,6 +71,7 @@ impl DocBuilder {
7071
let attempt: i32 = rows.get(0).get(0);
7172
if attempt >= 5 {
7273
::web::metrics::FAILED_BUILDS.inc();
74+
::web::metrics::TOTAL_BUILDS.inc();
7375
}
7476
error!("Failed to build package {}-{} from queue: {}",
7577
name,

src/utils/queue.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use postgres::Connection;
44
use error::Result;
55

66
pub fn add_crate_to_queue(conn: &Connection, name: &str, version: &str, priority: i32) -> Result<()> {
7-
::web::metrics::TOTAL_BUILDS.inc();
87
try!(conn.execute("INSERT INTO queue (name, version, priority) VALUES ($1, $2, $3)",
98
&[&name, &version, &priority]));
109
Ok(())

0 commit comments

Comments
 (0)