Skip to content

Commit cda433e

Browse files
committed
Retry connecting to the API upon Socket exceptions
Fixes springdoc#154
1 parent 0b20fe3 commit cda433e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/org/springdoc/openapi/gradle/plugin/OpenApiGeneratorTask.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import org.gradle.api.tasks.Optional
2121
import org.gradle.api.tasks.OutputDirectory
2222
import org.gradle.api.tasks.TaskAction
2323
import java.io.FileInputStream
24-
import java.net.ConnectException
2524
import java.net.HttpURLConnection
25+
import java.net.SocketException
2626
import java.net.URL
2727
import java.security.KeyStore
2828
import java.security.SecureRandom
@@ -95,7 +95,7 @@ open class OpenApiGeneratorTask : DefaultTask() {
9595
try {
9696
val isYaml = url.lowercase(Locale.getDefault()).matches(Regex(".+[./]yaml(/.+)*"))
9797
val sslContext = getCustomSslContext()
98-
await ignoreException ConnectException::class withPollInterval Durations.ONE_SECOND atMost Duration.of(
98+
await ignoreException SocketException::class withPollInterval Durations.ONE_SECOND atMost Duration.of(
9999
waitTimeInSeconds.get().toLong(),
100100
SECONDS
101101
) until {

0 commit comments

Comments
 (0)