diff options
author | Oleg Mitsura <oleg.mitsura@amdocs.com> | 2020-06-30 08:46:35 -0400 |
---|---|---|
committer | Oleg Mitsura <oleg.mitsura@amdocs.com> | 2020-06-30 08:48:25 -0400 |
commit | 273290a67a102a6b2da7cfc5407871c52fa126ee (patch) | |
tree | 68ce72699c07f039b94ab6728c22fcdcee782bbe /ms | |
parent | 34791d15a234063468d6bb358357f290b7d0fd7b (diff) |
RemoteAnsibleExecutor delay vs Thread.sleep bug
Issue-ID: CCSDK-2505
Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com>
Change-Id: I0115a484c61169f2cc031553ecd664796aff6bf8
Diffstat (limited to 'ms')
-rw-r--r-- | ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt index 6f994edab..1e70cdd9e 100644 --- a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt +++ b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt @@ -20,6 +20,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.ansible.executor import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.node.TextNode +import kotlinx.coroutines.delay import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService @@ -172,7 +173,7 @@ open class ComponentRemoteAnsibleExecutor( * its execution. Finally, it retrieves the job results via the stdout api. * The status and output attributes are populated in the process. */ - private fun runJobTemplateOnAWX( + private suspend fun runJobTemplateOnAWX( awxClient: BlueprintWebClientService, job_template_name: String?, jtId: String, @@ -210,7 +211,7 @@ open class ComponentRemoteAnsibleExecutor( val jobLaunched: JsonNode = mapper.readTree(response.body) jobStatus = jobLaunched.at("/status").asText() jobEndTime = jobLaunched.at("/finished").asText() - Thread.sleep(checkDelay) + delay(checkDelay) } log.info("Execution of job template $job_template_name in job #$jobId finished with status ($jobStatus) for requestId $processId") |