From bbc2f76d3de4a54a43ef09252a4294b596309e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geir=20Arne=20Waagb=C3=B8?= <79845894+geir-waagboe@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:16:15 +0200 Subject: [PATCH] Increase pdfgen timeout (#215) --- .../no/nav/syfo/application/DialogmeldingProcessor.kt | 3 ++- src/main/kotlin/no/nav/syfo/client/HttpClientCommon.kt | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/no/nav/syfo/application/DialogmeldingProcessor.kt b/src/main/kotlin/no/nav/syfo/application/DialogmeldingProcessor.kt index bccb6f48..b757bb89 100644 --- a/src/main/kotlin/no/nav/syfo/application/DialogmeldingProcessor.kt +++ b/src/main/kotlin/no/nav/syfo/application/DialogmeldingProcessor.kt @@ -1,5 +1,6 @@ package no.nav.syfo.application +import io.ktor.client.* import net.logstash.logback.argument.StructuredArguments import no.nav.helse.dialogmelding.XMLDialogmelding import no.nav.helse.eiFellesformat2.XMLEIFellesformat @@ -37,7 +38,7 @@ class DialogmeldingProcessor( ) { val pdfgenClient = PdfgenClient( url = env.syfopdfgen, - httpClient = httpClient, + httpClient = httpClientPdfgen, ) val pdlClient = PdlClient( diff --git a/src/main/kotlin/no/nav/syfo/client/HttpClientCommon.kt b/src/main/kotlin/no/nav/syfo/client/HttpClientCommon.kt index 4bbf3e43..97b3fb7b 100644 --- a/src/main/kotlin/no/nav/syfo/client/HttpClientCommon.kt +++ b/src/main/kotlin/no/nav/syfo/client/HttpClientCommon.kt @@ -23,6 +23,13 @@ val commonConfig: HttpClientConfig.() -> Unit = { expectSuccess = true } +val pdfGenConfig: HttpClientConfig.() -> Unit = { + this.commonConfig() + install(HttpTimeout) { + requestTimeoutMillis = 120 * 1000 + } +} + val retryAllConfig: HttpClientConfig.() -> Unit = { install(ContentNegotiation) { jackson { configure() } @@ -48,3 +55,4 @@ val proxyConfig: HttpClientConfig.() -> Unit = { val httpClient = HttpClient(Apache, commonConfig) val httpClientRetryAll = HttpClient(Apache, retryAllConfig) val httpClientWithProxy = HttpClient(Apache, proxyConfig) +val httpClientPdfgen = HttpClient(Apache, pdfGenConfig)