mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
UserThread must not be used before application is created.
This commit is contained in:
parent
6c28d1a097
commit
f5862ec2f6
@ -54,7 +54,6 @@ public class CommonSetup {
|
||||
Version.printVersion();
|
||||
maybePrintPathOfCodeSource();
|
||||
Profiler.printSystemLoad();
|
||||
UserThread.runPeriodically(Profiler::printSystemLoad, 10, TimeUnit.MINUTES);
|
||||
|
||||
setSystemProperties();
|
||||
setupSigIntHandlers(gracefulShutDownHandler);
|
||||
@ -62,6 +61,10 @@ public class CommonSetup {
|
||||
DevEnv.setup(config);
|
||||
}
|
||||
|
||||
public static void printSystemLoadPeriodically(int delayMin) {
|
||||
UserThread.runPeriodically(Profiler::printSystemLoad, delayMin, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
public static void setupUncaughtExceptionHandler(UncaughtExceptionHandler uncaughtExceptionHandler) {
|
||||
Thread.UncaughtExceptionHandler handler = (thread, throwable) -> {
|
||||
// Might come from another thread
|
||||
|
@ -98,7 +98,6 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet
|
||||
CommonSetup.setup(config, this);
|
||||
CoreSetup.setup(config);
|
||||
|
||||
configUserThread();
|
||||
addCapabilities();
|
||||
|
||||
// If application is JavaFX application we need to wait until it is initialized
|
||||
@ -121,10 +120,11 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet
|
||||
|
||||
// Headless versions can call inside launchApplication the onApplicationLaunched() manually
|
||||
protected void onApplicationLaunched() {
|
||||
configUserThread();
|
||||
CommonSetup.printSystemLoadPeriodically(10);
|
||||
// As the handler method might be overwritten by subclasses and they use the application as handler
|
||||
// we need to setup the handler after the application is created.
|
||||
CommonSetup.setupUncaughtExceptionHandler(this);
|
||||
|
||||
setupGuice();
|
||||
setupAvoidStandbyMode();
|
||||
startApplication();
|
||||
|
Loading…
Reference in New Issue
Block a user