Fixes memory not closing the response body
This commit is contained in:
@@ -28,7 +28,9 @@ object OnlineChecker {
|
|||||||
.get()
|
.get()
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
val result = HttpClient.getHttpClient().newCall(request).execute().code == 200
|
val result = HttpClient.getHttpClient().newCall(request).execute().use {
|
||||||
|
it.isSuccessful
|
||||||
|
}
|
||||||
checkOnlineCache.put(url, OnlineCheckResult(System.currentTimeMillis(), result))
|
checkOnlineCache.put(url, OnlineCheckResult(System.currentTimeMillis(), result))
|
||||||
result
|
result
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|||||||
Reference in New Issue
Block a user