This commit is contained in:
parent
5772b91b9a
commit
5bcecde83d
|
@ -16,17 +16,14 @@ import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
object MyGet {
|
object MyGet {
|
||||||
private const val TAG = "MyGet"
|
private const val TAG = "MyGet"
|
||||||
val affHttpClient: OkHttpClient = OkHttpClient()
|
val affHttpClient: OkHttpClient = OkHttpClient().apply {
|
||||||
|
dispatcher.maxRequests = 1000
|
||||||
fun getAffHttpClient(): OkHttpClient {
|
dispatcher.maxRequestsPerHost = 1000
|
||||||
affHttpClient.dispatcher.maxRequests = 1000
|
|
||||||
affHttpClient.dispatcher.maxRequestsPerHost = 1000
|
|
||||||
return affHttpClient
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun get(url_: String): String {
|
fun get(url_: String): String {
|
||||||
var response: Response? = null
|
var response: Response? = null
|
||||||
val client: OkHttpClient = getAffHttpClient().newBuilder()
|
val client: OkHttpClient = affHttpClient.newBuilder()
|
||||||
.connectTimeout(5, TimeUnit.SECONDS)
|
.connectTimeout(5, TimeUnit.SECONDS)
|
||||||
.readTimeout(5, TimeUnit.SECONDS)
|
.readTimeout(5, TimeUnit.SECONDS)
|
||||||
.build()
|
.build()
|
||||||
|
|
|
@ -159,6 +159,7 @@ object ChangeDeviceInfoUtil {
|
||||||
}
|
}
|
||||||
} catch (e: JSONException) {
|
} catch (e: JSONException) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
|
callBack.changeFailed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -785,7 +785,6 @@ object Util {
|
||||||
nRandom++
|
nRandom++
|
||||||
|
|
||||||
if (nRandom % 3 == 0) {
|
if (nRandom % 3 == 0) {
|
||||||
// execInstallTask(context);
|
|
||||||
execReloginTask(context)
|
execReloginTask(context)
|
||||||
} else {
|
} else {
|
||||||
execInstallTask(context)
|
execInstallTask(context)
|
||||||
|
|
Loading…
Reference in New Issue