Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

airbyte-to-flow: use write_all instead of write for responses #280

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions airbyte-to-flow/src/connector_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ async fn streaming_all(
response_stream_writer: Arc<Mutex<Pin<Box<dyn AsyncWrite + Sync + Send>>>>,
response_finished_sender: oneshot::Sender<bool>,
) -> Result<(), Error> {
let mut request_stream_reader =
StreamReader::new(request_stream);
let mut request_stream_reader = StreamReader::new(request_stream);

let request_stream_copy = async move {
copy(&mut request_stream_reader, &mut request_stream_writer).await?;
Expand All @@ -263,8 +262,8 @@ async fn streaming_all(
while let Some(result) = response_stream.next().await {
match result {
Ok(bytes) => {
writer.write(&bytes).await?;
},
writer.write_all(&bytes).await?;
}
// This error usually happens because there is an underlying error
// in the connector. We don't want this error to obscure the real error
// so we just log it as a debug and let the last output error
Expand All @@ -274,7 +273,7 @@ async fn streaming_all(
}
Err(e) => Err::<(), std::io::Error>(e.into())?,
}
};
}

response_finished_sender
.send(true)
Expand Down
Loading