CORDA-2991 shorten poll intervals for node info file propagation (#5240)

* CORDA-2991 shorten poll intervals for node info file propagation

* Relax minimum poll time constraint

* Relax, not comment out, minimum poll time constraint

* Correct error message
This commit is contained in:
Dominic Fox 2019-07-03 15:00:55 +01:00 committed by Rick Parker
parent 6df142bf7a
commit 14a20654bd
3 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class NodeInfoFilesCopier(scheduler: Scheduler = Schedulers.io()) : AutoCloseabl
private val subscription: Subscription
init {
this.subscription = Observable.interval(5, TimeUnit.SECONDS, scheduler)
this.subscription = Observable.interval(1, TimeUnit.SECONDS, scheduler)
.subscribe { poll() }
}

View File

@ -63,7 +63,7 @@ class NodeInfoWatcher(private val nodePath: Path,
val processedNodeInfoHashes: Set<SecureHash> get() = nodeInfoFilesMap.values.map { it.nodeInfohash }.toSet()
init {
require(pollInterval >= 5.seconds) { "Poll interval must be 5 seconds or longer." }
require(pollInterval >= 1.seconds) { "Poll interval must be 1 second or longer." }
nodeInfosDir.createDirectories()
}

View File

@ -264,6 +264,7 @@ class DriverDSLImpl(
"address" to portAllocation.nextHostAndPort().toString(),
"adminAddress" to portAllocation.nextHostAndPort().toString()
),
"additionalNodeInfoPollingFrequencyMsec" to 1000,
"devMode" to false) + customOverrides
val config = NodeConfig(ConfigHelper.loadConfig(
baseDirectory = baseDirectory,