diff --git a/lapis-docs/src/content/docs/maintainer-docs/references/starting-silo-and-lapis.mdx b/lapis-docs/src/content/docs/maintainer-docs/references/starting-silo-and-lapis.mdx index 71481be6f..f2292dcfa 100644 --- a/lapis-docs/src/content/docs/maintainer-docs/references/starting-silo-and-lapis.mdx +++ b/lapis-docs/src/content/docs/maintainer-docs/references/starting-silo-and-lapis.mdx @@ -90,6 +90,9 @@ LAPIS provides the following optional parameters: If set, the landing page (`/`) will show a "Documentation" link to the provided value. It is meant to point to your self-hosted version of this LAPIS documentation. If not set, the "Documentation" link on the landing page (`/`) will not be shown. +- `--silo.infoTimeout`: + How long LAPIS waits when it asks SILO for its info (data version and SILO version), + e.g. `100ms`, `1s`. Defaults to `100ms`. #### Starting LAPIS with Docker diff --git a/lapis/src/main/kotlin/org/genspectrum/lapis/silo/SiloClient.kt b/lapis/src/main/kotlin/org/genspectrum/lapis/silo/SiloClient.kt index 5ee16bf9a..d785184c7 100644 --- a/lapis/src/main/kotlin/org/genspectrum/lapis/silo/SiloClient.kt +++ b/lapis/src/main/kotlin/org/genspectrum/lapis/silo/SiloClient.kt @@ -10,6 +10,7 @@ import org.genspectrum.lapis.logging.RequestContext import org.genspectrum.lapis.logging.RequestIdContext import org.genspectrum.lapis.response.InfoData import org.genspectrum.lapis.util.YamlObjectMapper +import org.springframework.beans.factory.annotation.Value import org.springframework.cache.annotation.Cacheable import org.springframework.http.HttpHeaders import org.springframework.http.HttpStatus @@ -92,6 +93,7 @@ open class CachedSiloClient( private val requestContext: RequestContext, private val config: DatabaseConfig, private val rootAllocator: RootAllocator, + @param:Value("\${silo.infoTimeout:100ms}") private val infoTimeout: Duration, ) { private val httpClient = HttpClient.newBuilder() // Create our own thread pool explicitly to not use the ForkJoinPool.commonPool() @@ -176,7 +178,7 @@ open class CachedSiloClient( bodyHandler = BodyHandlers.ofString(), tryToReadSiloErrorFromBody = ::tryToReadSiloErrorFromString, ) { - it.timeout(Duration.ofMillis(100)) // this should never take long, make sure we don't block anything else + it.timeout(infoTimeout) it.GET() }