postpone connecting to I2P after the main frame has been shown

dbus-notify
Zlatin Balevsky 2022-04-11 16:54:53 +01:00
parent 00886c57ab
commit 1c5adb9b28
No known key found for this signature in database
GPG Key ID: A72832072D525E41
2 changed files with 7 additions and 4 deletions

View File

@ -237,8 +237,7 @@ public class Core {
router = new Router(routerProps)
router.getContext().setLogManager(new MuWireLogManager())
router.runRouter()
while(!router.isRunning())
Thread.sleep(100)
Thread.sleep(5000)
}
log.info("initializing I2P socket manager")
@ -559,11 +558,11 @@ public class Core {
it.init(this)
}
i2pConnector.connect()
watchedDirectoryConverter.convert()
hasherService.start()
trustService.start()
trustService.waitForLoad()
i2pConnector.connect()
contentManager.start()
hostCache.start({connectionManager.getConnections().collect{ it.endpoint.destination }} as Supplier)
connectionManager.start()

View File

@ -108,13 +108,17 @@ class Ready extends AbstractLifecycleHandler {
Runtime.getRuntime().addShutdownHook({
core.shutdown()
})
core.startServices()
application.context.put("core",core)
application.getPropertyChangeListeners("core").each {
it.propertyChange(new PropertyChangeEvent(this, "core", null, core))
}
core.eventBus.publish(new UILoadedEvent())
def initer = {core.startServices()} as Runnable
initer = new Thread(initer, "core initializer")
initer.setDaemon(true)
initer.start()
} catch (Exception bad) {
log.log(Level.SEVERE,"couldn't initialize core",bad)