TP-62782 | Removed overrided maxHost per domain check from rr client (#10360)
This commit is contained in:
@@ -118,7 +118,6 @@ object FirebaseRemoteConfigHelper {
|
||||
const val NAVI_LOCATION_DECIMAL_PRECISION = "NAVI_LOCATION_DECIMAL_PRECISION"
|
||||
|
||||
const val UPI_SCRATCH_CARD_REWARDS_POLLING_CONFIG = "UPI_SCRATCH_CARD_REWARDS_POLLING_CONFIG"
|
||||
const val RR_MAX_REQUEST_PER_HOST_KEY = "RR_MAX_REQUEST_PER_HOST_KEY"
|
||||
|
||||
fun init() {
|
||||
remoteConfig = getFirebaseRemoteConfig()
|
||||
|
||||
@@ -473,8 +473,4 @@
|
||||
<key>UPI_SCRATCH_CARD_REWARDS_POLLING_CONFIG</key>
|
||||
<value>{ "interval": 1, "numOfRetries": 20, "initialDelay": 0 }</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>RR_MAX_REQUEST_PER_HOST_KEY</key>
|
||||
<value>10</value>
|
||||
</entry>
|
||||
</defaultsMap>
|
||||
@@ -10,11 +10,9 @@ package com.navi.rr.network.retrofit
|
||||
import android.content.Context
|
||||
import com.chuckerteam.chucker.api.ChuckerCollector
|
||||
import com.chuckerteam.chucker.api.ChuckerInterceptor
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
|
||||
import com.navi.common.model.NetworkInfo
|
||||
import com.navi.common.network.BaseHttpClient
|
||||
import com.navi.rr.BuildConfig
|
||||
import okhttp3.Dispatcher
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
|
||||
@@ -41,18 +39,9 @@ class NaviHttpClient(networkInfo: NetworkInfo, private val context: Context) :
|
||||
}
|
||||
|
||||
}
|
||||
setDispatcherAndRequestLimit(okHttpClientBuilder)
|
||||
return okHttpClientBuilder
|
||||
}
|
||||
|
||||
|
||||
private fun setDispatcherAndRequestLimit(builder: OkHttpClient.Builder) {
|
||||
val dispatcher = Dispatcher().apply {
|
||||
maxRequestsPerHost = FirebaseRemoteConfigHelper.getLong(FirebaseRemoteConfigHelper.RR_MAX_REQUEST_PER_HOST_KEY).toInt()
|
||||
}
|
||||
builder.dispatcher(dispatcher)
|
||||
}
|
||||
|
||||
private fun loggingInterceptor() =
|
||||
HttpLoggingInterceptor().apply { setLevel(HttpLoggingInterceptor.Level.BODY) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user