We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3bcf0f commit 611c406Copy full SHA for 611c406
src/main/kotlin/com/gabrielfeo/gradle/enterprise/api/Api.kt
@@ -33,13 +33,17 @@ var accessToken: () -> String = {
33
}
34
35
/**
36
- * Shutdown the internal OkHttp client, releasing resources and allowing the program to finish
37
- * before the client's idle timeout.
+ * Shutdown the internal client, releasing resources and allowing the program to
+ * finish before the client's idle timeout.
38
*
39
* https://square.github.io/okhttp/4.x/okhttp/okhttp3/-ok-http-client/#shutdown-isnt-necessary
40
*/
41
fun shutdown() {
42
- okHttpClient.dispatcher.executorService.shutdownNow()
+ okHttpClient.run {
43
+ dispatcher.executorService.shutdown()
44
+ connectionPool.evictAll();
45
+ cache?.close();
46
+ }
47
48
49
0 commit comments