[3.3.0] upload per one hour cache file
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.zhjt.mogo_core_function_devatools.trace
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
|
||||
@@ -12,6 +14,7 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManage
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import com.zhidao.loglib.call.LogInfoManagerFactory
|
||||
import com.zhidao.loglib.fw.FileWriteManager
|
||||
import com.zhidao.loglib.fw.FwBuild
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -23,9 +26,18 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
||||
private var init = false
|
||||
private var mContext: Context? = null
|
||||
|
||||
private val handler = Handler(Looper.getMainLooper()) {
|
||||
if (it.what == 1) {
|
||||
LogInfoManagerFactory.cacheTraceLogUpload()
|
||||
delayUpload()
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
const val TAG = "TraceManager"
|
||||
private const val DELAY_UPLOAD = 60 * 60 * 1000L
|
||||
|
||||
val traceManager by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
TraceManager()
|
||||
@@ -111,9 +123,14 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
||||
}
|
||||
CallerDevaToolsListenerManager.invokeDevaToolsFwThreadClose()
|
||||
}
|
||||
delayUpload()
|
||||
init = true
|
||||
}
|
||||
|
||||
private fun delayUpload() {
|
||||
handler.sendEmptyMessageDelayed(1, DELAY_UPLOAD)
|
||||
}
|
||||
|
||||
override fun tokenGot(token: String, sn: String) {
|
||||
FileWriteManager.getInstance().updateDeviceId(sn)
|
||||
syncConfig()
|
||||
@@ -148,7 +165,7 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
|
||||
syncConfig()
|
||||
}
|
||||
|
||||
fun syncConfig(){
|
||||
fun syncConfig() {
|
||||
mContext?.let {
|
||||
SyncConfig.update(it)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user