Skip to content

Commit

Permalink
Merge pull request #190 from opentargets/keep_alive_elastic_client
Browse files Browse the repository at this point in the history
customising elastic client with keep alive
  • Loading branch information
jdhayhurst authored Jul 11, 2024
2 parents 56b0142 + 0473570 commit 68a4191
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/models/Backend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import models.entities.MousePhenotypes._
import models.entities.Pharmacogenomics._
import models.entities.SearchFacetsResults._
import models.entities._
import org.apache.http.impl.nio.reactor.IOReactorConfig
import play.api.cache.AsyncCacheApi
import play.api.db.slick.DatabaseConfigProvider
import play.api.libs.json._
Expand All @@ -48,7 +49,11 @@ class Backend @Inject() (implicit
/** return meta information loaded from ot.meta settings */
lazy val getMeta: Meta = defaultOTSettings.meta
lazy val getESClient: ElasticClient = ElasticClient(
JavaClient(ElasticProperties(s"http://${defaultESSettings.host}:${defaultESSettings.port}"))
JavaClient(
ElasticProperties(s"http://${defaultESSettings.host}:${defaultESSettings.port}"),
httpClientConfigCallback =
_.setDefaultIOReactorConfig(IOReactorConfig.custom.setSoKeepAlive(true).build())
)
)
val allSearchableIndices: Seq[String] = defaultESSettings.entities
.withFilter(_.searchIndex.isDefined)
Expand Down

0 comments on commit 68a4191

Please sign in to comment.