mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Merge pull request #4963 from chimp1984/fix-case-if-no-data-store-service-is-available
Call completeHandler if services in store services is empty.
This commit is contained in:
commit
113bb4f7f2
@ -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