mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +01:00
Remove temporary messages at startup.
This commit is contained in:
@@ -107,8 +107,11 @@ class LifecycleManagerImpl implements LifecycleManager, MigrationListener {
|
|||||||
else logDuration(LOG, "Creating database", start);
|
else logDuration(LOG, "Creating database", start);
|
||||||
|
|
||||||
db.transaction(false, txn -> {
|
db.transaction(false, txn -> {
|
||||||
|
long start1 = now();
|
||||||
|
db.removeTemporaryMessages(txn);
|
||||||
|
logDuration(LOG, "Removing temporary messages", start1);
|
||||||
for (OpenDatabaseHook hook : openDatabaseHooks) {
|
for (OpenDatabaseHook hook : openDatabaseHooks) {
|
||||||
long start1 = now();
|
start1 = now();
|
||||||
hook.onDatabaseOpened(txn);
|
hook.onDatabaseOpened(txn);
|
||||||
if (LOG.isLoggable(FINE)) {
|
if (LOG.isLoggable(FINE)) {
|
||||||
logDuration(LOG, "Calling open database hook "
|
logDuration(LOG, "Calling open database hook "
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public class LifecycleManagerImplTest extends BrambleMockTestCase {
|
|||||||
oneOf(db).open(dbKey, lifecycleManager);
|
oneOf(db).open(dbKey, lifecycleManager);
|
||||||
will(returnValue(false));
|
will(returnValue(false));
|
||||||
oneOf(db).transaction(with(false), withDbRunnable(txn));
|
oneOf(db).transaction(with(false), withDbRunnable(txn));
|
||||||
|
oneOf(db).removeTemporaryMessages(txn);
|
||||||
allowing(eventBus).broadcast(with(any(LifecycleEvent.class)));
|
allowing(eventBus).broadcast(with(any(LifecycleEvent.class)));
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user