Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason0729 committed Dec 25, 2023
1 parent 44bd8ff commit 72bae18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion backend/src/controller/judger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl From<Error> for Status {
match value {
Error::JudgerResourceExhausted => Status::resource_exhausted("no available judger"),
Error::BadArgument(x) => Status::invalid_argument(format!("bad argument: {}", x)),
Error::LangNotFound=>Status::not_found("languaue not found"),
Error::LangNotFound => Status::not_found("languaue not found"),
Error::JudgerError(x) => report_internal!(info, "`{}`", x),
Error::Database(x) => report_internal!(warn, "{}", x),
Error::TransportLayer(x) => report_internal!(info, "{}", x),
Expand Down
14 changes: 7 additions & 7 deletions backend/src/controller/judger/route/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ impl ConnectionDetail {
}

/// Deref Guard for Upstream
///
/// Be aware that you need to call report_success() to use ConnGuard
///
/// Be aware that you need to call report_success() to use ConnGuard
/// without minus healthy score
///
///
/// The guard is needed because we need to store used connection back to Upstream
pub struct ConnGuard {
upstream: Arc<Upstream>,
Expand Down Expand Up @@ -126,8 +126,8 @@ impl Drop for ConnGuard {
}

/// keep discovering new Upstream from config(IE: docker swarm, static address)
///
/// occupy future, should generally be spawn in a green thread
///
/// occupy future, should generally be spawn in a green thread
async fn discover<I: Routable + Send>(
config: JudgerConfig,
router: Weak<Router>,
Expand Down Expand Up @@ -174,7 +174,7 @@ async fn discover<I: Routable + Send>(
}

/// Router offer interface for user to manage languages and load balancing
///
///
/// Basically it's a thick client and also provide ability to list supported languages
/// and get judger client correspond to the chosen languages
pub struct Router {
Expand Down Expand Up @@ -215,7 +215,7 @@ impl Router {
Ok(self_)
}
/// get judger client correspond to the chosen languages
///
///
/// fail if language not found(maybe the judger become unhealthy)
pub async fn get(&self, lang: &Uuid) -> Result<ConnGuard, Error> {
let queue = self
Expand Down

0 comments on commit 72bae18

Please sign in to comment.