Skip to content

Commit

Permalink
refactor: move public function to the top
Browse files Browse the repository at this point in the history
  • Loading branch information
fengelniederhammer committed Feb 28, 2024
1 parent b1972cd commit ac2dbd3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lapis2/src/main/kotlin/org/genspectrum/lapis/silo/SiloClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ class SiloClient(
}
}

fun callInfo(): InfoData {
log.info { "Calling SILO info" }

val client = HttpClient.newHttpClient()
val request = HttpRequest.newBuilder(URI("$siloUrl/info")).GET().build()

val response = send(client, request)

return InfoData(getDataVersion(response))
}

private fun send(
client: HttpClient,
request: HttpRequest?,
Expand Down Expand Up @@ -105,17 +116,6 @@ class SiloClient(
null
}

fun callInfo(): InfoData {
log.info { "Calling SILO info" }

val client = HttpClient.newHttpClient()
val request = HttpRequest.newBuilder(URI("$siloUrl/info")).GET().build()

val response = send(client, request)

return InfoData(getDataVersion(response))
}

private fun addDataVersionToRequestScope(response: HttpResponse<String>) {
dataVersion.dataVersion = getDataVersion(response)
}
Expand Down

0 comments on commit ac2dbd3

Please sign in to comment.