Skip to content

Commit

Permalink
Fix Transport::flush implementation for TransportThread (#678)
Browse files Browse the repository at this point in the history
Description for the `flush` function of the `Transport` trait states that
"If the queue was successfully drained, the return value should be `true`.",
but implementation of the trait on `tokio_thread::TransportThread`
do the oposite. The same error for `thread::TransportThread`.

Co-authored-by: Francesco Vigliaturo <[email protected]>
  • Loading branch information
manifest and viglia authored Oct 3, 2024
1 parent 1f65ac8 commit 16baf61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sentry/src/transports/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl TransportThread {
pub fn flush(&self, timeout: Duration) -> bool {
let (sender, receiver) = sync_channel(1);
let _ = self.sender.send(Task::Flush(sender));
receiver.recv_timeout(timeout).is_err()
receiver.recv_timeout(timeout).is_ok()
}
}

Expand Down
2 changes: 1 addition & 1 deletion sentry/src/transports/tokio_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl TransportThread {
pub fn flush(&self, timeout: Duration) -> bool {
let (sender, receiver) = sync_channel(1);
let _ = self.sender.send(Task::Flush(sender));
receiver.recv_timeout(timeout).is_err()
receiver.recv_timeout(timeout).is_ok()
}
}

Expand Down

0 comments on commit 16baf61

Please sign in to comment.