Skip to content

Commit

Permalink
Update async-http-client to 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
magro committed Dec 30, 2024
1 parent 9c29b75 commit dd7a331
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ val slf4jVersion = "2.0.16"

libraryDependencies ++= Seq(
"org.apache.solr" % "solr-solrj" % solrVersion,
"org.asynchttpclient" % "async-http-client" % "2.12.3",
"org.asynchttpclient" % "async-http-client" % "3.0.1",
"org.scala-lang.modules" %% "scala-xml" % "2.3.0",
"org.scala-lang.modules" %% "scala-java8-compat"% "1.0.2",
"io.dropwizard.metrics" % "metrics-core" % "4.2.29" % "optional",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.ino.solrs

import java.net.ConnectException
import java.time.{Duration => JavaDuration}
import java.util.concurrent.atomic.{AtomicBoolean, AtomicLong}
import java.util.concurrent.{ExecutionException, TimeUnit, TimeoutException}
import javax.servlet._
Expand All @@ -21,7 +22,7 @@ class PingStatusObserverIntegrationSpec extends AnyFunSpec with BeforeAndAfterAl
import PingStatusObserverIntegrationSpec._

private implicit val awaitTimeout: FiniteDuration = 2000 millis
private val httpClientTimeout = 100
private val httpClientTimeout = JavaDuration.ofMillis(100)
private val httpClient = new DefaultAsyncHttpClient(new DefaultAsyncHttpClientConfig.Builder().setRequestTimeout(httpClientTimeout).build)

protected var solrRunner: SolrRunner = _
Expand Down Expand Up @@ -94,7 +95,7 @@ class PingStatusObserverIntegrationSpec extends AnyFunSpec with BeforeAndAfterAl
solrServers(0).status should be (Enabled)

responseDelayMillis.set(5000)
val httpClientConfig = new DefaultAsyncHttpClientConfig.Builder().setReadTimeout(100).build()
val httpClientConfig = new DefaultAsyncHttpClientConfig.Builder().setReadTimeout(JavaDuration.ofMillis(100)).build()
val asyncHttpClient = new DefaultAsyncHttpClient(httpClientConfig)
try {

Expand Down Expand Up @@ -135,7 +136,7 @@ class PingStatusObserverIntegrationSpec extends AnyFunSpec with BeforeAndAfterAl

private def enable(solrUrl: String, timeoutInMillis: Long = 600) = pingAction(solrUrl, "enable", timeoutInMillis)
private def disable(solrUrl: String) = pingAction(solrUrl, "disable")
private def pingAction(solrUrl: String, action: String, timeoutInMillis: Long = httpClientTimeout * 2) =
private def pingAction(solrUrl: String, action: String, timeoutInMillis: Long = httpClientTimeout.toMillis * 2) =
httpClient.prepareGet(s"$solrUrl/admin/ping?action=$action").execute().get(timeoutInMillis, TimeUnit.MILLISECONDS)

}
Expand Down

0 comments on commit dd7a331

Please sign in to comment.