@@ -72,7 +72,9 @@ impl DocBuilder {
72
72
. get ( 0 ) )
73
73
}
74
74
75
- /// Builds the top package from the queue. Returns whether the queue was empty.
75
+ /// Builds the top package from the queue. Returns whether there was a package in the queue.
76
+ ///
77
+ /// Note that this will return `Ok(true)` even if the package failed to build.
76
78
pub ( crate ) fn build_next_queue_package (
77
79
& mut self ,
78
80
builder : & mut RustwideBuilder ,
@@ -84,10 +86,10 @@ impl DocBuilder {
84
86
85
87
let query = conn. query (
86
88
"SELECT id, name, version
87
- FROM queue
88
- WHERE attempt < 5
89
- ORDER BY priority ASC, attempt ASC, id ASC
90
- LIMIT 1" ,
89
+ FROM queue
90
+ WHERE attempt < 5
91
+ ORDER BY priority ASC, attempt ASC, id ASC
92
+ LIMIT 1" ,
91
93
& [ ] ,
92
94
) ?;
93
95
@@ -105,7 +107,6 @@ impl DocBuilder {
105
107
let conn = self . db . get ( ) ?;
106
108
107
109
let _ = conn. execute ( "DELETE FROM queue WHERE id = $1" , & [ & id] ) ;
108
- crate :: web:: metrics:: TOTAL_BUILDS . inc ( ) ;
109
110
}
110
111
Err ( e) => {
111
112
let conn = self . db . get ( ) ?;
@@ -118,7 +119,6 @@ impl DocBuilder {
118
119
let attempt: i32 = rows. get ( 0 ) . get ( 0 ) ;
119
120
if attempt >= 5 {
120
121
crate :: web:: metrics:: FAILED_BUILDS . inc ( ) ;
121
- crate :: web:: metrics:: TOTAL_BUILDS . inc ( ) ;
122
122
}
123
123
error ! (
124
124
"Failed to build package {}-{} from queue: {}\n Backtrace: {}" ,
@@ -130,6 +130,7 @@ impl DocBuilder {
130
130
}
131
131
}
132
132
133
+ crate :: web:: metrics:: TOTAL_BUILDS . inc ( ) ;
133
134
Ok ( true )
134
135
}
135
136
}
0 commit comments