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 committed Sep 18, 2024
1 parent 0b20fe3 commit cda433e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ 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.HttpURLConnection
import java.net.SocketException
import java.net.URL
import java.security.KeyStore
import java.security.SecureRandom
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 cda433e

Please sign in to comment.