mirror of
https://github.com/corda/corda.git
synced 2025-04-09 04:15:35 +00:00
Add logging to node startup when it attempt to connect to the map server (#167)
* Add logging to avoid node startup "hang" when it attempt to connects to the network map, also can use as a hint telling user Network map might be down or unreachable.
This commit is contained in:
parent
2ec31781c1
commit
aeb5a59605
@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory
|
||||
import java.lang.management.ManagementFactory
|
||||
import java.net.InetAddress
|
||||
import java.nio.file.Paths
|
||||
import kotlin.concurrent.thread
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
private var renderBasicInfoToConsole = true
|
||||
@ -85,6 +86,14 @@ fun main(args: Array<String>) {
|
||||
node.start()
|
||||
printPluginsAndServices(node)
|
||||
|
||||
thread {
|
||||
Thread.sleep(30.seconds.toMillis())
|
||||
while (!node.networkMapRegistrationFuture.isDone) {
|
||||
printBasicNodeInfo("Waiting for response from network map ...")
|
||||
Thread.sleep(30.seconds.toMillis())
|
||||
}
|
||||
}
|
||||
|
||||
node.networkMapRegistrationFuture.success {
|
||||
val elapsed = (System.currentTimeMillis() - startTime) / 10 / 100.0
|
||||
printBasicNodeInfo("Node started up and registered in $elapsed sec")
|
||||
|
Loading…
x
Reference in New Issue
Block a user