mirror of
https://github.com/corda/corda.git
synced 2025-01-31 16:35:43 +00:00
Fixed a merge error and parameterised host for upload rates.
This commit is contained in:
parent
9fc89fc4a2
commit
5de855e045
@ -153,7 +153,7 @@ fun runIRSDemo(args: Array<String>, useInMemoryMessaging: Boolean = false): Int
|
||||
"http://localhost:" + (Node.DEFAULT_PORT + 1)
|
||||
}
|
||||
|
||||
if(!runDateChange(dateStr)) {
|
||||
if(!runDateChange(dateStr, host)) {
|
||||
return 1
|
||||
}
|
||||
} else {
|
||||
@ -267,7 +267,7 @@ private fun runNode(nodeParams : NodeParams, useInMemoryMessaging: Boolean) : Un
|
||||
ExitServerProtocol.Handler.register(node)
|
||||
|
||||
if(nodeParams.uploadRates) {
|
||||
runUploadRates()
|
||||
runUploadRates("http://localhost:31341")
|
||||
}
|
||||
|
||||
try {
|
||||
@ -277,12 +277,12 @@ private fun runNode(nodeParams : NodeParams, useInMemoryMessaging: Boolean) : Un
|
||||
}
|
||||
}
|
||||
|
||||
private fun runUploadRates() {
|
||||
private fun runUploadRates(host) {
|
||||
val fileContents = IOUtils.toString(NodeParams::class.java.getResource("example.rates.txt"))
|
||||
var timer : Timer? = null
|
||||
timer = fixedRateTimer("upload-rates", false, 0, 5000, {
|
||||
try {
|
||||
val url = URL("http://localhost:31341/upload/interest-rates")
|
||||
val url = URL(host + "/upload/interest-rates")
|
||||
if(uploadFile(url, fileContents)) {
|
||||
timer!!.cancel()
|
||||
println("Rates uploaded successfully")
|
||||
|
@ -34,6 +34,7 @@ private fun setupNodeA(dir: Path) {
|
||||
private fun setupNodeB(dir: Path) {
|
||||
runIRSDemo(arrayOf("--role", "SetupNodeB", "--dir", dir.toString()))
|
||||
}
|
||||
|
||||
private fun startNodeA(dir: Path) {
|
||||
thread(true, false, null, "NodeA", -1, { runIRSDemo(arrayOf("--role", "NodeA", "--dir", dir.toString()), true) })
|
||||
Thread.sleep(15000)
|
||||
|
Loading…
x
Reference in New Issue
Block a user