mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Improve resyncDaoStateFromResources method
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
parent
3a2061a538
commit
90ca73a82b
1 changed files with 10 additions and 10 deletions
|
@ -323,20 +323,20 @@ public class DaoStateSnapshotService implements DaoSetupService, DaoStateListene
|
|||
|
||||
private void resyncDaoStateFromResources() {
|
||||
log.info("resyncDaoStateFromResources called");
|
||||
if (resyncDaoStateFromResourcesHandler == null && ++daoRequiresRestartHandlerAttempts <= 3) {
|
||||
if (resyncDaoStateFromResourcesHandler == null) {
|
||||
if (++daoRequiresRestartHandlerAttempts <= 3) {
|
||||
log.warn("resyncDaoStateFromResourcesHandler has not been initialized yet, will try again in 10 seconds");
|
||||
UserThread.runAfter(this::resyncDaoStateFromResources, 10); // a delay for the app to init
|
||||
return;
|
||||
} else {
|
||||
log.warn("No resyncDaoStateFromResourcesHandler has not been set. We shutdown non-gracefully with a failure code on exit");
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
try {
|
||||
daoStateStorageService.removeAndBackupAllDaoData();
|
||||
// the restart handler informs the user of the need to restart bisq (in desktop mode)
|
||||
if (resyncDaoStateFromResourcesHandler == null) {
|
||||
log.error("resyncDaoStateFromResourcesHandler COULD NOT be called as it has not been initialized yet");
|
||||
} else {
|
||||
log.info("calling resyncDaoStateFromResourcesHandler...");
|
||||
resyncDaoStateFromResourcesHandler.run();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("Error at resyncDaoStateFromResources: {}", e.toString());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue