Skip to content

Commit

Permalink
Adjusted suspend function calls.
Browse files Browse the repository at this point in the history
Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
AWSHurneyt committed Feb 2, 2024
1 parent 5ee95d0 commit 695ed1f
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,16 @@ class TransportGetRemoteIndexesAction @Inject constructor(
}

val clusterIndexList = mutableListOf<ClusterIndex>()
indexes.forEach {
clusterIndexList.add(
ClusterIndex(
indexName = it,
indexHealth = clusterHealthResponse!!.indices[it]!!.status,
mappings = mappingsResponse?.mappings?.get(it)
if (clusterHealthResponse != null) {
indexes.forEach {
clusterIndexList.add(
ClusterIndex(
indexName = it,
indexHealth = clusterHealthResponse.indices[it]!!.status,
mappings = mappingsResponse?.mappings?.get(it)
)
)
)
}
}

clusterIndexesList.add(
Expand Down Expand Up @@ -176,9 +178,12 @@ class TransportGetRemoteIndexesAction @Inject constructor(
val clusterHealthRequest = ClusterHealthRequest()
.indices(*parsedIndexesNames.toTypedArray())
.indicesOptions(IndicesOptions.lenientExpandHidden())
return targetClient.suspendUntil {
admin().cluster().health(clusterHealthRequest, it)
}

return client.suspendUntil { targetClient.admin().cluster().health(clusterHealthRequest, it) }
// TODO hurneyt delete
// return targetClient.suspendUntil {
// admin().cluster().health(clusterHealthRequest, it)
// }
}

private suspend fun getIndexMappings(targetClient: Client, parsedIndexNames: List<String>): GetMappingsResponse {
Expand Down

0 comments on commit 695ed1f

Please sign in to comment.