Skip to content

Commit a34216c

Browse files
authored
Merge pull request #473 from happytomatoe/master
Fix backoffs with randomness in TransactorNo
2 parents e9318ca + 728def5 commit a34216c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/com/googlecode/objectify/impl/TransactorNo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public <R> R transactNew(final ObjectifyImpl parent, int limitTries, final Work<
109109
log.trace("Details of transaction failure", ex);
110110
try {
111111
// Do increasing backoffs with randomness
112-
Thread.sleep(Math.min(10000, (long) (0.5 * Math.random() + 0.5) * 200 * (ORIGINAL_TRIES - limitTries + 2)));
112+
Thread.sleep(Math.min(10000, (long) ((0.5 * Math.random() + 0.5) * 200 * (ORIGINAL_TRIES - limitTries + 2))));
113113
} catch (InterruptedException ignored) {
114114
}
115115
} else {
@@ -172,4 +172,4 @@ private <R> R transactOnce(final ObjectifyImpl parent, final Work<R> work, final
172172
}
173173
}
174174
}
175-
}
175+
}

0 commit comments

Comments
 (0)