Skip to content

Commit

Permalink
Remove unwrap from consumer
Browse files Browse the repository at this point in the history
Although those unwraps seem safe, it's still better not not have
app panicking at all.
Even in case of those somehow failing, client will recover by itself
on next iteration of the timer.

Signed-off-by: Tomasz Pietrek <[email protected]>
  • Loading branch information
Jarema committed Aug 26, 2024
1 parent ed856c9 commit 2634d01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions async-nats/src/jetstream/consumer/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ impl Stream {
.into()
}))
.await
.unwrap();
.ok();
trace!("result send over tx");
}
}
Expand Down Expand Up @@ -1092,7 +1092,7 @@ impl futures::Stream for Stream {
&& !self.pending_request
{
debug!("pending messages reached threshold to send new fetch request");
self.request_tx.send(()).unwrap();
self.request_tx.send(()).ok();
self.pending_request = true;
}

Expand Down

0 comments on commit 2634d01

Please sign in to comment.