Skip to content

Commit ac3db81

Browse files
author
Brian Chen
authored
fix: add flush check in BulkWriter.sendBatchLocked() callback (#631)
1 parent afa91ff commit ac3db81

File tree

1 file changed

+4
-2
lines changed
  • google-cloud-firestore/src/main/java/com/google/cloud/firestore

1 file changed

+4
-2
lines changed

google-cloud-firestore/src/main/java/com/google/cloud/firestore/BulkWriter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,8 +988,10 @@ private void sendBatchLocked(final BulkCommitBatch batch, final boolean flush) {
988988
new Runnable() {
989989
@Override
990990
public void run() {
991-
synchronized (lock) {
992-
scheduleCurrentBatchLocked(flush);
991+
if (flush) {
992+
synchronized (lock) {
993+
scheduleCurrentBatchLocked(/* flush= */ true);
994+
}
993995
}
994996
}
995997
},

0 commit comments

Comments
 (0)