Skip to content

Commit dc991e8

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

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,7 +21,7 @@ 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
24+
import java.net.SocketException
2525
import java.net.HttpURLConnection
2626
import java.net.URL
2727
import java.security.KeyStore
@@ -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)