Skip to content

Commit

Permalink
Retry connecting to the API upon Socket exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
hosamaly authored Sep 18, 2024
1 parent 0b20fe3 commit dc991e8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import java.io.FileInputStream
import java.net.ConnectException
import java.net.SocketException
import java.net.HttpURLConnection
import java.net.URL
import java.security.KeyStore
Expand Down Expand Up @@ -95,7 +95,7 @@ open class OpenApiGeneratorTask : DefaultTask() {
try {
val isYaml = url.lowercase(Locale.getDefault()).matches(Regex(".+[./]yaml(/.+)*"))
val sslContext = getCustomSslContext()
await ignoreException ConnectException::class withPollInterval Durations.ONE_SECOND atMost Duration.of(
await ignoreException SocketException::class withPollInterval Durations.ONE_SECOND atMost Duration.of(
waitTimeInSeconds.get().toLong(),
SECONDS
) until {
Expand Down

0 comments on commit dc991e8

Please sign in to comment.