Skip to content

Commit

Permalink
read timeeout duration inf
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-Eliat-Eliat committed Nov 15, 2024
1 parent bf7f02d commit 2d8d40c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/scala/cognite/spark/v1/FileContentRelation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import sttp.client3.{SttpBackend, UriContext, asStreamUnsafe, basicRequest}
import sttp.model.Uri

import scala.collection.immutable._
import scala.concurrent.duration.Duration

//The trait exist for testing purposes
trait WithSizeLimit {
Expand Down Expand Up @@ -105,6 +106,7 @@ class FileContentRelation(config: RelationConfig, fileExternalId: String, inferS
val request = basicRequest
.get(link)
.response(asStreamUnsafe(Fs2Streams[IO]))
.readTimeout(Duration.Inf)

Stream.eval(backend.send(request)).flatMap { response =>
response.body match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ object SttpClientBackendFactory {
.setThreadFactory(clientThreadFactory)
.setNettyTimer(new HashedWheelTimer(timerThreadFactory))
//Timeout override for potentially long stream operation
requestTimeoutMs.foreach(options.setRequestTimeout)
requestTimeoutMs.foreach(
options.setRequestTimeout
)
options.setTimeout
options
}
)
Expand Down

0 comments on commit 2d8d40c

Please sign in to comment.