mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Fix wrong thread at shutdownhook
This commit is contained in:
parent
6f641bff1c
commit
a4573208b4
@ -67,17 +67,9 @@ public class FileManager<T> {
|
||||
saveNowInternal(serializable);
|
||||
return null;
|
||||
};
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
FileManager.this.shutDown();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
UserThread.execute(FileManager.this::shutDown);
|
||||
}, "FileManager.ShutDownHook"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -119,8 +119,9 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||
openOffers.forEach(e -> e.getOffer().setPriceFeed(priceFeed));
|
||||
|
||||
// In case the app did get killed the shutDown from the modules is not called, so we use a shutdown hook
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(OpenOfferManager.this::shutDown,
|
||||
"OpenOfferManager.ShutDownHook"));
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
UserThread.execute(OpenOfferManager.this::shutDown);
|
||||
}, "OpenOfferManager.ShutDownHook"));
|
||||
}
|
||||
|
||||
public void onAllServicesInitialized() {
|
||||
|
@ -359,7 +359,7 @@ public class BitsquareApp extends Application {
|
||||
log.info("App shutdown complete");
|
||||
System.exit(0);
|
||||
});
|
||||
}, 100, TimeUnit.MILLISECONDS);
|
||||
}, 200, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
private void gracefulShutDown(ResultHandler resultHandler) {
|
||||
|
Loading…
Reference in New Issue
Block a user