Skip to content

Commit

Permalink
Removed useless result (#4683)
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton authored Mar 6, 2024
1 parent 6a79dd9 commit 735685b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions quickwit/quickwit-ingest/src/ingest_v2/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ impl IngestRouter {
&mut self,
ingest_request: IngestRequestV2,
max_num_attempts: usize,
) -> IngestV2Result<IngestResponseV2> {
) -> IngestResponseV2 {
let commit_type = ingest_request.commit_type();
let mut workbench = IngestWorkbench::new(ingest_request.subrequests, max_num_attempts);
while !workbench.is_complete() {
Expand All @@ -438,7 +438,7 @@ impl IngestRouter {
self.retry_batch_persist(ingest_request, MAX_PERSIST_ATTEMPTS),
)
.await
.map_err(|_| IngestV2Error::Timeout)?
.map_err(|_| IngestV2Error::Timeout)
}
}

Expand Down
7 changes: 3 additions & 4 deletions quickwit/quickwit-ingest/src/ingest_v2/workbench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use quickwit_proto::ingest::ingester::{PersistFailure, PersistFailureReason, Per
use quickwit_proto::ingest::router::{
IngestFailure, IngestFailureReason, IngestResponseV2, IngestSubrequest, IngestSuccess,
};
use quickwit_proto::ingest::IngestV2Result;
use quickwit_proto::types::{NodeId, SubrequestId};
use tracing::warn;

Expand Down Expand Up @@ -163,7 +162,7 @@ impl IngestWorkbench {
self.record_failure(subrequest_id, SubworkbenchFailure::Internal(error_message));
}

pub fn into_ingest_response(self) -> IngestV2Result<IngestResponseV2> {
pub fn into_ingest_response(self) -> IngestResponseV2 {
let num_subworkbenches = self.subworkbenches.len();
let mut successes = Vec::with_capacity(self.num_successes);
let mut failures = Vec::with_capacity(num_subworkbenches - self.num_successes);
Expand All @@ -188,10 +187,10 @@ impl IngestWorkbench {
}
}
assert_eq!(successes.len() + failures.len(), num_subworkbenches);
Ok(IngestResponseV2 {
IngestResponseV2 {
successes,
failures,
})
}
}

#[cfg(test)]
Expand Down

0 comments on commit 735685b

Please sign in to comment.