mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
More unit tests for DatabaseComponent.
This commit is contained in:
@@ -176,10 +176,11 @@ class SynchronizedDatabaseComponent<Txn> extends DatabaseComponentImpl<Txn> {
|
||||
Batch batch = fillBatch(c, capacity);
|
||||
if(batch == null) break; // No more messages to send
|
||||
b.addBatch(batch);
|
||||
capacity -= batch.getSize();
|
||||
long size = batch.getSize();
|
||||
capacity -= size;
|
||||
// If the batch is less than half full, stop trying - there may be
|
||||
// more messages trickling in but we can't wait forever
|
||||
if(batch.getSize() * 2 < Batch.CAPACITY) break;
|
||||
if(size * 2 < Batch.CAPACITY) break;
|
||||
}
|
||||
b.seal();
|
||||
if(LOG.isLoggable(Level.FINE))
|
||||
|
||||
Reference in New Issue
Block a user