Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Feb 11, 2025
1 parent 2d41036 commit ace026c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
10 changes: 4 additions & 6 deletions apollo-router/src/compute_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,10 @@ mod tests {
#[tokio::test]
async fn test_executes_on_different_thread() {
let test_thread = std::thread::current().id();
let job_thread = execute(Priority::P4, || {
std::thread::current().id()
})
.unwrap()
.await
.unwrap();
let job_thread = execute(Priority::P4, || std::thread::current().id())
.unwrap()
.await
.unwrap();
assert_ne!(job_thread, test_thread)
}

Expand Down
7 changes: 3 additions & 4 deletions apollo-router/src/introspection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,9 @@ impl IntrospectionCache {
let schema = schema.clone();
let doc = doc.clone();
let priority = compute_job::Priority::P1; // Low priority
let response = compute_job::execute(
priority,
move || Self::execute_introspection(max_depth, &schema, &doc),
)?
let response = compute_job::execute(priority, move || {
Self::execute_introspection(max_depth, &schema, &doc)
})?
// `expect()` propagates any panic that potentially happens in the closure, but:
//
// * We try to avoid such panics in the first place and consider them bugs
Expand Down
5 changes: 3 additions & 2 deletions apollo-router/src/services/supergraph/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ async fn service_call(
Err(err) => {
let status = match &err {
CacheResolverError::Backpressure(_) => StatusCode::SERVICE_UNAVAILABLE,
CacheResolverError::RetrievalError(_) |
CacheResolverError::BatchingError(_) => StatusCode::BAD_REQUEST,
CacheResolverError::RetrievalError(_) | CacheResolverError::BatchingError(_) => {
StatusCode::BAD_REQUEST
}
};
match err.into_graphql_errors() {
Ok(gql_errors) => {
Expand Down

0 comments on commit ace026c

Please sign in to comment.