Skip to content

Commit

Permalink
Fix misnamed redis variables (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Sep 26, 2022
1 parent 36f7adb commit 7a962a6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions shotover-proxy/src/transforms/util/cluster_connection_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,36 +244,36 @@ async fn tx_process<C: CodecWriteHalf, W: AsyncWrite + Unpin + Send + 'static>(
return_tx: UnboundedSender<Request>,
codec: C,
) -> Result<()> {
let in_w = FramedWrite::new(write, codec);
let writer = FramedWrite::new(write, codec);
let rx_stream = UnboundedReceiverStream::new(out_rx).map(|x| {
let ret = Ok(vec![x.message.clone()]);
return_tx.send(x)?;
ret
});
rx_stream.forward(in_w).await
rx_stream.forward(writer).await
}

async fn rx_process<C: CodecReadHalf, R: AsyncRead + Unpin + Send + 'static>(
read: R,
mut return_rx: UnboundedReceiver<Request>,
codec: C,
) -> Result<()> {
let mut in_r = FramedRead::new(read, codec);
let mut reader = FramedRead::new(read, codec);

while let Some(maybe_req) = in_r.next().await {
match maybe_req {
Ok(req) => {
for m in req {
while let Some(responses) = reader.next().await {
match responses {
Ok(responses) => {
for response_message in responses {
if let Some(Request {
message,
message: request_message,
return_chan: Some(ret),
..
}) = return_rx.recv().await
{
// If the receiver hangs up, just silently ignore
let _ = ret.send(Response {
original: message,
response: Ok(m),
original: request_message,
response: Ok(response_message),
});
}
}
Expand Down

0 comments on commit 7a962a6

Please sign in to comment.