Skip to content

Commit f8c3912

Browse files
authored
Merge pull request #486 from pietroalbini/priority
web: show the priority in the queue
2 parents 3e548dc + c0b23f2 commit f8c3912

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/web/releases.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -555,14 +555,21 @@ pub fn activity_handler(req: &mut Request) -> IronResult<Response> {
555555

556556
pub fn build_queue_handler(req: &mut Request) -> IronResult<Response> {
557557
let conn = extension!(req, Pool);
558-
let mut crates: Vec<(String, String)> = Vec::new();
559-
for krate in &conn.query("SELECT name, version
558+
let mut crates: Vec<(String, String, i32)> = Vec::new();
559+
for krate in &conn.query("SELECT name, version, priority
560560
FROM queue
561561
WHERE attempt < 5
562562
ORDER BY priority ASC, attempt ASC, id ASC",
563563
&[])
564564
.unwrap() {
565-
crates.push((krate.get(0), krate.get(1)));
565+
crates.push((
566+
krate.get("name"),
567+
krate.get("version"),
568+
// The priority here is inverted: in the database if a crate has a higher priority it
569+
// will be built after everything else, which is counter-intuitive for people not
570+
// familiar with docs.rs's inner workings.
571+
-krate.get::<_, i32>("priority"),
572+
));
566573
}
567574
let is_empty = crates.is_empty();
568575
Page::new(crates)

templates/releases_queue.hbs

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@
1313

1414
<ol class="queue-list">
1515
{{#each content}}
16-
<li><a href="https://crates.io/crates/{{this.[0]}}">{{this.[0]}}-{{this.[1]}}</a></li>
16+
<li>
17+
<a href="https://crates.io/crates/{{this.[0]}}">
18+
{{this.[0]}} {{this.[1]}}
19+
</a>
20+
{{#if this.[2]}}
21+
(priority: {{this.[2]}})
22+
{{/if}}
23+
</li>
1724
{{/each}}
1825
</ol>
1926
</div>

0 commit comments

Comments
 (0)