Skip to content

Commit

Permalink
Increase read timeout for siret extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
charlescd committed Jan 28, 2025
1 parent ce0cf84 commit 8bb2140
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/services/SiretExtractorService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import sttp.model.Header
import tasks.website.ExtractionResultApi

import scala.concurrent.Future
import scala.concurrent.duration.DurationInt

class SiretExtractorService(siretExtractorConfiguration: SiretExtractorConfiguration) {

Expand All @@ -30,6 +31,7 @@ class SiretExtractorService(siretExtractorConfiguration: SiretExtractorConfigura
logger.debug(s"Calling siret extractor with website $website")
val url = uri"${siretExtractorConfiguration.url}/extract"
val request = basicRequest
.readTimeout(30.minutes) // scrapping can last a long time
.headers(Header("X-Api-Key", siretExtractorConfiguration.apiKey))
.post(url)
.response(asJson[JsValue])
Expand Down

0 comments on commit 8bb2140

Please sign in to comment.