Merge remote-tracking branch 'origin/dev_robotaxi-d_250117_6.10.0_del_login_loop' into dev_robotaxi-d_250417_8.0.0

# Conflicts:
#	OCH/common/biz/src/main/java/com/mogo/och/biz/login/ui/debugview/BusinessView.kt
This commit is contained in:
yangyakun
2025-05-16 11:45:35 +08:00
4 changed files with 12 additions and 11 deletions

View File

@@ -66,14 +66,14 @@ object LoginServiceManager : IOchLanPassengerStatusListener {
if (oldValue != newValue) {
OchChainLogManager.writeChainLog("登录状态变化", "${oldValue}-->${newValue}")
Log.d(tag, "登录状态变化:${oldValue}-->${newValue}")
if (newValue == EnumLoginStatus.Login && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
BizLoopManager.setLoopFunction(
TAGLoopStatus,
LoopInfo(60 * 2, ::queryLoginStatusByNet, immediately = false, scheduler = Schedulers.io())
)
} else {
BizLoopManager.removeLoopFunction(TAGLoopStatus)
}
// if (newValue == EnumLoginStatus.Login && AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
// BizLoopManager.setLoopFunction(
// TAGLoopStatus,
// LoopInfo(60 * 2, ::queryLoginStatusByNet, immediately = false, scheduler = Schedulers.io())
// )
// } else {
// BizLoopManager.removeLoopFunction(TAGLoopStatus)
// }
LoginStatusManager.invokeLoginStatusChange(loginStatus)
}
}

View File

@@ -15,7 +15,6 @@ class FRetryWithTime<T : BaseData> : Function<T, ObservableSource<T>> {
override fun apply(baseData: T): ObservableSource<T> {
baseData.let {
if (it.code == 100046 || it.code == 100045 || it.code == 100005 || it.code == 100006 || it.code == 520003) {
MoGoAiCloudClient.getInstance().refreshToken()
return Observable.error(OchCommonRetryException())
}else if(it.code == 1003){
CallerLogger.e(M_OCHCOMMON, "接口失败报错 1003:需重新查询登录状态")

View File

@@ -3,6 +3,7 @@ package com.mogo.och.common.module.network.interceptor
import com.mogo.eagle.core.utilcode.constant.TimeConstants
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.mogo.och.common.module.utils.CallerLoggerUtils.flavorTag
import io.reactivex.Observable
import io.reactivex.ObservableSource
@@ -15,12 +16,13 @@ class RetryWithTime : Function<Observable<Throwable?>, ObservableSource<Any?>> {
private const val TAG = "RetryWithTime"
}
var current = -1
private var timeDelys = intArrayOf(3, 1, 2)
private var timeDelys = intArrayOf(6, 2, 4)
override fun apply(throwableObservable: Observable<Throwable?>): ObservableSource<Any?>? {
return throwableObservable.flatMap {
++current
CallerLogger.e("${flavorTag}$TAG", " 时间:${TimeUtils.getStringByNow(0, TimeConstants.SEC)}")
if (it is OchCommonRetryException && current < timeDelys.size) {
OchChainLogManager.writeChainLogError("token超时","${timeDelys[current]}s后重试")
Observable.timer(timeDelys[current].toLong(), TimeUnit.SECONDS)
} else {
Observable.error(it)