Skip to content

Commit c6d16c6

Browse files
committed
Sort PRs on the queue page
1 parent 715e860 commit c6d16c6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/github/server.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ use crate::templates::{
1717
use crate::{BorsGlobalEvent, BorsRepositoryEvent, PgDbClient, TeamApiClient};
1818

1919
use super::AppError;
20+
use super::GithubRepoName;
21+
use crate::utils::sort_queue::sort_queue_prs;
2022
use anyhow::Error;
2123
use axum::Router;
2224
use axum::extract::{Path, State};
@@ -34,8 +36,6 @@ use tower::limit::ConcurrencyLimitLayer;
3436
use tower_http::catch_panic::CatchPanicLayer;
3537
use tracing::{Instrument, Span};
3638

37-
use super::GithubRepoName;
38-
3939
/// Shared server state for all axum handlers.
4040
pub struct ServerState {
4141
repository_event_queue: mpsc::Sender<BorsRepositoryEvent>,
@@ -150,6 +150,7 @@ async fn queue_handler(
150150
};
151151

152152
let prs = state.db.get_nonclosed_pull_requests(&repo.name).await?;
153+
let prs = sort_queue_prs(prs);
153154

154155
let (in_queue_count, failed_count, rolled_up_count) =
155156
prs.iter()

0 commit comments

Comments
 (0)