mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Call completeHandler if services in store services is empty.
If oen starts with --daoActivated=false there is no service set up in one of the data store services so it never calls the result handler and the app never starts up.
This commit is contained in:
parent
c5c93b213d
commit
f270b9c6fa
@ -209,13 +209,6 @@ public class P2PDataStorage implements MessageListener, ConnectionListener, Pers
|
||||
BooleanProperty protectedDataStoreServiceReady = new SimpleBooleanProperty();
|
||||
BooleanProperty resourceDataStoreServiceReady = new SimpleBooleanProperty();
|
||||
|
||||
appendOnlyDataStoreService.readFromResources(postFix, () -> appendOnlyDataStoreServiceReady.set(true));
|
||||
protectedDataStoreService.readFromResources(postFix, () -> {
|
||||
map.putAll(protectedDataStoreService.getMap());
|
||||
protectedDataStoreServiceReady.set(true);
|
||||
});
|
||||
resourceDataStoreService.readFromResources(postFix, () -> resourceDataStoreServiceReady.set(true));
|
||||
|
||||
readFromResourcesCompleteBinding = EasyBind.combine(appendOnlyDataStoreServiceReady,
|
||||
protectedDataStoreServiceReady,
|
||||
resourceDataStoreServiceReady,
|
||||
@ -225,6 +218,13 @@ public class P2PDataStorage implements MessageListener, ConnectionListener, Pers
|
||||
completeHandler.run();
|
||||
}
|
||||
});
|
||||
|
||||
appendOnlyDataStoreService.readFromResources(postFix, () -> appendOnlyDataStoreServiceReady.set(true));
|
||||
protectedDataStoreService.readFromResources(postFix, () -> {
|
||||
map.putAll(protectedDataStoreService.getMap());
|
||||
protectedDataStoreServiceReady.set(true);
|
||||
});
|
||||
resourceDataStoreService.readFromResources(postFix, () -> resourceDataStoreServiceReady.set(true));
|
||||
}
|
||||
|
||||
// Uses synchronous execution on the userThread. Only used by tests. The async methods should be used by app code.
|
||||
|
@ -55,6 +55,10 @@ public class AppendOnlyDataStoreService {
|
||||
}
|
||||
|
||||
public void readFromResources(String postFix, Runnable completeHandler) {
|
||||
if (services.isEmpty()) {
|
||||
completeHandler.run();
|
||||
return;
|
||||
}
|
||||
AtomicInteger remaining = new AtomicInteger(services.size());
|
||||
services.forEach(service -> {
|
||||
service.readFromResources(postFix, () -> {
|
||||
|
@ -56,6 +56,10 @@ public class ProtectedDataStoreService {
|
||||
}
|
||||
|
||||
public void readFromResources(String postFix, Runnable completeHandler) {
|
||||
if (services.isEmpty()) {
|
||||
completeHandler.run();
|
||||
return;
|
||||
}
|
||||
AtomicInteger remaining = new AtomicInteger(services.size());
|
||||
services.forEach(service -> {
|
||||
service.readFromResources(postFix, () -> {
|
||||
|
@ -46,6 +46,10 @@ public class ResourceDataStoreService {
|
||||
}
|
||||
|
||||
public void readFromResources(String postFix, Runnable completeHandler) {
|
||||
if (services.isEmpty()) {
|
||||
completeHandler.run();
|
||||
return;
|
||||
}
|
||||
AtomicInteger remaining = new AtomicInteger(services.size());
|
||||
services.forEach(service -> {
|
||||
service.readFromResources(postFix, () -> {
|
||||
|
Loading…
Reference in New Issue
Block a user