fix BatchExecutorQueue bug (#11927)

Co-authored-by: earthchen <earthchen1996@gmail.com>
This commit is contained in:
icodening 2023-03-28 11:05:25 +08:00 committed by GitHub
parent 89e271408d
commit 88853e0177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ public class BatchExecutorQueue<T> {
boolean flushedOnce = false;
while ((item = snapshot.poll()) != null) {
if (snapshot.size() == 0) {
i = 0;
flushedOnce = false;
break;
}
if (i == chunkSize) {
@ -74,7 +74,7 @@ public class BatchExecutorQueue<T> {
i++;
}
}
if ((i != 0 || !flushedOnce) && item != null) {
if (!flushedOnce && item != null) {
flush(item);
}
} finally {