mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Add setupStage and setDatabaseCorruptionHandler methods
This commit is contained in:
parent
8a266b16bb
commit
101365aef6
1 changed files with 56 additions and 46 deletions
|
@ -175,16 +175,24 @@ public class BisqApp extends Application {
|
|||
if (Utilities.isLinux())
|
||||
System.setProperty("prism.lcdtext", "false");
|
||||
|
||||
Storage.setDatabaseCorruptionHandler((String fileName) -> {
|
||||
corruptedDatabaseFiles.add(fileName);
|
||||
if (mainView != null)
|
||||
mainView.setPersistedFilesCorrupted(corruptedDatabaseFiles);
|
||||
});
|
||||
setupStage();
|
||||
|
||||
setDatabaseCorruptionHandler(mainView);
|
||||
|
||||
checkForCorrectOSArchitecture();
|
||||
|
||||
UserThread.runPeriodically(() -> Profiler.printSystemLoad(log), LOG_MEMORY_PERIOD_MIN, TimeUnit.MINUTES);
|
||||
} catch (Throwable throwable) {
|
||||
log.error("Error during app init", throwable);
|
||||
showErrorPopup(throwable, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void setupStage() {
|
||||
// load the main view and create the main scene
|
||||
CachingViewLoader viewLoader = injector.getInstance(CachingViewLoader.class);
|
||||
mainView = (MainView) viewLoader.load(MainView.class);
|
||||
mainView.setPersistedFilesCorrupted(corruptedDatabaseFiles);
|
||||
|
||||
|
||||
scene = new Scene(mainView.getRoot(), INITIAL_SCENE_WIDTH, INITIAL_SCENE_HEIGHT);
|
||||
|
||||
|
@ -222,13 +230,15 @@ public class BisqApp extends Application {
|
|||
|
||||
// make the UI visible
|
||||
primaryStage.show();
|
||||
|
||||
checkForCorrectOSArchitecture();
|
||||
UserThread.runPeriodically(() -> Profiler.printSystemLoad(log), LOG_MEMORY_PERIOD_MIN, TimeUnit.MINUTES);
|
||||
} catch (Throwable throwable) {
|
||||
log.error("Error during app init", throwable);
|
||||
showErrorPopup(throwable, false);
|
||||
}
|
||||
|
||||
private void setDatabaseCorruptionHandler(MainView mainView) {
|
||||
Storage.setDatabaseCorruptionHandler((String fileName) -> {
|
||||
corruptedDatabaseFiles.add(fileName);
|
||||
if (mainView != null)
|
||||
mainView.setPersistedFilesCorrupted(corruptedDatabaseFiles);
|
||||
});
|
||||
mainView.setPersistedFilesCorrupted(corruptedDatabaseFiles);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue