mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-29 00:57:17 -04:00
Move ActorSystem shutdown logic out of SystemTray
This commit is contained in:
parent
fa7d7a08a5
commit
b9e9882865
3 changed files with 21 additions and 19 deletions
|
@ -29,12 +29,20 @@ import io.bitsquare.trade.TradeModule;
|
|||
import io.bitsquare.user.User;
|
||||
import io.bitsquare.util.ConfigLoader;
|
||||
|
||||
import com.google.inject.Injector;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import akka.actor.ActorSystem;
|
||||
import scala.concurrent.duration.Duration;
|
||||
|
||||
public class BitsquareModule extends AbstractBitsquareModule {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BitsquareModule.class);
|
||||
|
||||
public BitsquareModule() {
|
||||
this(ConfigLoader.loadConfig());
|
||||
}
|
||||
|
@ -77,5 +85,16 @@ public class BitsquareModule extends AbstractBitsquareModule {
|
|||
protected GuiModule guiModule() {
|
||||
return new GuiModule(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doClose(Injector injector) {
|
||||
ActorSystem actorSystem = injector.getInstance(ActorSystem.class);
|
||||
actorSystem.shutdown();
|
||||
try {
|
||||
actorSystem.awaitTermination(Duration.create(5L, "seconds"));
|
||||
} catch (Exception ex) {
|
||||
log.error("Actor system failed to shut down properly", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue