[3.2.0][应用升级] 每隔一小时检查一次升级
This commit is contained in:
@@ -25,6 +25,7 @@ import com.mogo.eagle.core.utilcode.util.FileUtils
|
||||
import kotlinx.coroutines.*
|
||||
import okhttp3.*
|
||||
import java.util.TreeMap
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
@@ -48,7 +49,6 @@ class UpgradeAppNetWorkManager private constructor() {
|
||||
val macAddress = mac //"48:b0:2d:4d:31:7f"
|
||||
val type = screenType //"10"
|
||||
SharedPrefsMgr.getInstance(context!!).putString(SharedPrefsConstants.HOST_ADDRESS, HostConst.getHost())
|
||||
|
||||
try {
|
||||
val records = provider?.getUpgradeRecords()?.also {
|
||||
MogoAnalyticUtils.track("AppUpgradeRecord", TreeMap<String, Any>().also { itx ->
|
||||
@@ -83,6 +83,8 @@ class UpgradeAppNetWorkManager private constructor() {
|
||||
provider?.recordUpgradeRequestFailed(t.message ?: "更新接口请求失败")
|
||||
deleteApkFile()
|
||||
}
|
||||
delay(TimeUnit.HOURS.toMillis(1))
|
||||
getAppUpgradeInfo(context, mac, screenType)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user