diff options
author | 2018-07-09 13:09:56 +0200 | |
---|---|---|
committer | 2018-08-02 12:38:55 +0200 | |
commit | af92961d8e79769dbd70340ab661f7a42b783435 (patch) | |
tree | d973fa0dc99a851dedecf64d252e86c24d963524 /hv-collector-core/src/main | |
parent | a788d58f813b71644059623877aca629ab49ab74 (diff) |
Fix consul configuration delay
Delay configuration received from consul instead of default one
Change-Id: I09ec1a1e0d4a8334f83c054e0891b55ff8d049db
Issue-Id: ONAP-519
Signed-off-by: jdudycz@nokia.com
Issue-ID: DCAEGEN2-601
Diffstat (limited to 'hv-collector-core/src/main')
-rw-r--r-- | hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProvider.kt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProvider.kt b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProvider.kt index 727f025b..786bc7ce 100644 --- a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProvider.kt +++ b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProvider.kt @@ -64,7 +64,7 @@ internal class ConsulConfigurationProvider(private val url: String, withFixedPartitioning() } }.build()) - ).doOnNext { logger.info("Applied default configuration") }.delayElement(firstRequestDelay) + ).doOnNext { logger.info("Applied default configuration") } private fun createConsulFlux(): Flux<CollectorConfiguration> = http.get(url, mapOf(Pair("index", lastModifyIndex.get()))) @@ -79,6 +79,7 @@ internal class ConsulConfigurationProvider(private val url: String, .map(::decodeConfiguration) .map(::createCollectorConfiguration) .repeat() + .delaySubscription(firstRequestDelay) private fun parseJsonResponse(responseString: String): JsonObject = Json.createReader(StringReader(responseString)).readArray().first().asJsonObject() |