Skip to content

Commit

Permalink
[DL-717] feedback Toom 2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre.teilhet committed Oct 8, 2024
1 parent c9be7c0 commit 7103b71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions app/org/thp/cortex/util/docker/DockerClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ class DockerClient(config: Configuration) {
.awaitStatusCode()
logger.info(s"container $containerId started and awaited with code: $waitResult")

0
} recover {
case e =>
logger.error(s"execute container $containerId failed", e)

1
waitResult
}

def prepare(image: String, jobDirectory: Path, jobBaseDirectory: Path, dockerJobBaseDirectory: Path, timeout: FiniteDuration): Try[String] = Try {
Expand Down Expand Up @@ -95,9 +90,9 @@ class DockerClient(config: Configuration) {
.pullImageCmd(image)
.start()
.awaitCompletion()
val timeout = config.getOptional[Long]("docker.pullImageTimeout")
val timeout = config.get[FiniteDuration]("docker.pullImageTimeout")

pullImageResultCbk.awaitCompletion(timeout.getOrElse(10000), TimeUnit.MILLISECONDS)
pullImageResultCbk.awaitCompletion(timeout.toMillis, TimeUnit.MILLISECONDS)
}

def clean(containerId: String): Try[Unit] = Try {
Expand Down
2 changes: 1 addition & 1 deletion conf/application.sample
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ docker {
memorySwappiness = 0
}
autoUpdate = false
pullImageTimeout = 10000
pullImageTimeout = 10 minutes
}

# It's the end my friend. Happy hunting!

0 comments on commit 7103b71

Please sign in to comment.