File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
libraries/apollo-tooling/src/main/kotlin/com/apollographql/apollo/tooling Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -189,5 +189,10 @@ object SchemaDownloader {
189
189
return data.graph.variant.latestPublication.schema.document
190
190
}
191
191
192
+ fun shutdown () {
193
+ SchemaHelper .client.dispatcher.executorService.shutdown()
194
+ SchemaHelper .client.connectionPool.evictAll()
195
+ }
196
+
192
197
inline fun <reified T > Any?.cast () = this as ? T
193
198
}
Original file line number Diff line number Diff line change @@ -31,10 +31,12 @@ import javax.net.ssl.SSLSocketFactory
31
31
import javax.net.ssl.X509TrustManager
32
32
33
33
internal object SchemaHelper {
34
+ internal val client = OkHttpClient ()
35
+
34
36
internal fun newOkHttpClient (insecure : Boolean ): OkHttpClient {
35
37
val connectTimeoutSeconds = System .getProperty(" okHttp.connectTimeout" , " 600" ).toLong()
36
38
val readTimeoutSeconds = System .getProperty(" okHttp.readTimeout" , " 600" ).toLong()
37
- val clientBuilder = OkHttpClient . Builder ()
39
+ val clientBuilder = client.newBuilder ()
38
40
.connectTimeout(connectTimeoutSeconds, TimeUnit .SECONDS )
39
41
.readTimeout(readTimeoutSeconds, TimeUnit .SECONDS )
40
42
You can’t perform that action at this time.
0 commit comments