aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions
diff options
context:
space:
mode:
authorBrinda Santh <bs2796@att.com>2020-01-17 15:08:46 -0500
committerBrinda Santh <bs2796@att.com>2020-01-17 15:08:46 -0500
commitfed6c23200eba54f0f1995e56bbaf6a6c1f42396 (patch)
treecf7b8bef791b82deaf9b9e913db5ac24d95cca2c /ms/blueprintsprocessor/functions
parent8029f8e5332f107267ec11293c3099e54e87c67b (diff)
Fix scheduler shutdown config function.
Optimize application name accessing in Docker Compose. Issue-ID: CCSDK-1917 Signed-off-by: Brinda Santh <bs2796@att.com> Change-Id: I6b055de7ef5a8ac4a0c103499997ed272bd74ac6
Diffstat (limited to 'ms/blueprintsprocessor/functions')
-rw-r--r--ms/blueprintsprocessor/functions/message-prioritizaion/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/service/MessagePrioritizationSchedulerService.kt9
-rw-r--r--ms/blueprintsprocessor/functions/message-prioritizaion/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt2
2 files changed, 6 insertions, 5 deletions
diff --git a/ms/blueprintsprocessor/functions/message-prioritizaion/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/service/MessagePrioritizationSchedulerService.kt b/ms/blueprintsprocessor/functions/message-prioritizaion/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/service/MessagePrioritizationSchedulerService.kt
index 2f08c1c34..aaefcc773 100644
--- a/ms/blueprintsprocessor/functions/message-prioritizaion/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/service/MessagePrioritizationSchedulerService.kt
+++ b/ms/blueprintsprocessor/functions/message-prioritizaion/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/service/MessagePrioritizationSchedulerService.kt
@@ -38,10 +38,10 @@ open class MessagePrioritizationSchedulerService(
/** This is sample scheduler implementation used during starting application with configuration.
@EventListener(ApplicationReadyEvent::class)
open fun init() = runBlocking {
- log.info("Starting PrioritizationListeners...")
- startScheduling(MessagePrioritizationSample.samplePrioritizationConfiguration())
+ log.info("Starting PrioritizationListeners...")
+ startScheduling(MessagePrioritizationSample.samplePrioritizationConfiguration())
}
- */
+ */
open suspend fun startScheduling() {
val prioritizationConfiguration = messagePrioritizationService.getConfiguration()
@@ -55,8 +55,9 @@ open class MessagePrioritizationSchedulerService(
}
}
- open suspend fun shutdownScheduling(prioritizationConfiguration: PrioritizationConfiguration) {
+ open suspend fun shutdownScheduling() {
keepGoing = false
+ val prioritizationConfiguration = messagePrioritizationService.getConfiguration()
delay(prioritizationConfiguration.shutDownConfiguration.waitMill)
}
diff --git a/ms/blueprintsprocessor/functions/message-prioritizaion/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt b/ms/blueprintsprocessor/functions/message-prioritizaion/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt
index 7f150f5f3..35bc49402 100644
--- a/ms/blueprintsprocessor/functions/message-prioritizaion/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt
+++ b/ms/blueprintsprocessor/functions/message-prioritizaion/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/message/prioritization/MessagePrioritizationConsumerTest.kt
@@ -207,7 +207,7 @@ open class MessagePrioritizationConsumerTest {
launch {
/** To debug increase the delay time */
delay(20)
- messagePrioritizationSchedulerService.shutdownScheduling(configuration)
+ messagePrioritizationSchedulerService.shutdownScheduling()
}
}
}