Skip to content

Commit c155799

Browse files
daeSpeedy37
authored andcommitted
fix broken transact() limits
The logic was backwards - if a retry limit is set (say 50), 1 < 50 is true, so is_none() is false and transact() immediately aborts.
1 parent 31cd3c4 commit c155799

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

foundationdb/src/database.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ impl Database {
133133
let mut trx = self.create_trx()?;
134134
let mut can_retry = move || {
135135
tries += 1;
136-
retry_limit.filter(|&limit| tries < limit).is_none()
137-
&& time_out.filter(|&t| Instant::now() < t).is_none()
136+
retry_limit.filter(|&limit| tries > limit).is_none()
137+
&& time_out.filter(|&t| Instant::now() > t).is_none()
138138
};
139139
loop {
140140
let r = f.transact(trx).await;

0 commit comments

Comments
 (0)