[3.2.0][应用升级] 清除一天前的升级记录

This commit is contained in:
renwj
2023-05-18 10:42:48 +08:00
parent a7f4f33294
commit c556eedcd0

View File

@@ -18,6 +18,7 @@ import com.zhjt.mogo_core_function_devatools.upgrade.provider.db.vo.UpgradeRecor
import com.zhjt.service.chain.*
import com.zhjt.service.chain.TracingConstants.Endpoint
import java.util.TreeMap
import java.util.concurrent.TimeUnit
@Route(path = MogoServicePaths.PATH_UPGRADE_TYPE_API)
class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
@@ -235,6 +236,10 @@ class MoGoUpgradeProviderImpl: IMoGoUpgradeProvider {
if (left.isNotEmpty()) {
UpgradeDbHelper.deleteRecords(left.map { it.versionName })
}
if (fail != null && fail.time <= (System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1))) {
//清除一天前的数据
UpgradeDbHelper.deleteRecord(fail.versionName)
}
return TreeMap<String, List<Pair<String, String>>>().also { itx ->
if (success != null) {
val all = UpgradeDbHelper.getUpgradeRecordFull(success.versionName)