Skip to content

Commit

Permalink
Build100.1.0
Browse files Browse the repository at this point in the history
  - Release
  • Loading branch information
Hamza417 committed Feb 13, 2024
1 parent ff47608 commit 2fb9003
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import app.simple.inure.extensions.viewmodels.WrappedViewModel
import app.simple.inure.preferences.TrialPreferences
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import okhttp3.ConnectionPool
import okhttp3.OkHttpClient
import org.json.JSONObject
import java.util.concurrent.TimeUnit

class GumroadLicenceAuthenticatorViewModel(application: Application) : WrappedViewModel(application) {

Expand Down Expand Up @@ -44,9 +42,7 @@ class GumroadLicenceAuthenticatorViewModel(application: Application) : WrappedVi
viewModelScope.launch(Dispatchers.IO) {
runCatching {
TrafficStats.setThreadStatsTag(0xF00D)
val httpClient = OkHttpClient().newBuilder()
.connectionPool(ConnectionPool(0, 5, TimeUnit.SECONDS))
.build()
val httpClient = OkHttpClient()

val request = okhttp3.Request.Builder()
.url("https://api.gumroad.com/v2/licenses/verify")
Expand Down Expand Up @@ -145,7 +141,8 @@ class GumroadLicenceAuthenticatorViewModel(application: Application) : WrappedVi
Log.d("GumroadLicenceAuthenticatorViewModel", TrafficStats.getThreadStatsTag().toString())
TrafficStats.clearThreadStatsTag()
response.close()
httpClient.dispatcher().executorService().shutdown()
httpClient.dispatcher.executorService.shutdown()
httpClient.connectionPool.evictAll()
}.getOrElse {
postWarning(it.message.toString())
it.printStackTrace()
Expand Down

0 comments on commit 2fb9003

Please sign in to comment.