Skip to content

Commit

Permalink
Add a debug_assert to ensure we don't try to use broken transaction m…
Browse files Browse the repository at this point in the history
…anagers
  • Loading branch information
weiznich committed Nov 26, 2024
1 parent 7c6f301 commit 12878dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/transaction_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ impl AnsiTransactionManager {
where
F: std::future::Future,
{
debug_assert!(
!is_broken.load(Ordering::Relaxed),
"Tried to execute a transaction SQL on transaction manager that was previously cancled"
);
is_broken.store(true, Ordering::Relaxed);
let res = f.await;
is_broken.store(false, Ordering::Relaxed);
Expand Down

0 comments on commit 12878dd

Please sign in to comment.