fix: 快照迁移错误

This commit is contained in:
lisonge 2023-10-09 21:38:02 +08:00
parent 241d491a49
commit 646fd68d68

View File

@ -60,7 +60,7 @@ class HomePageVm @Inject constructor() : ViewModel() {
}
appScope.launchTry(Dispatchers.IO) {
// 迁移快照记录
val oldDbFile = File(FolderExt.dbFolder, "snapshot.db-wal")
val oldDbFile = File(FolderExt.dbFolder, "snapshot.db")
if (oldDbFile.exists()) {
SnapshotExt.snapshotDir.walk().maxDepth(1).filter { f -> f.isDirectory }
.mapNotNull { f -> f.name.toLongOrNull() }.forEach { snapshotId ->
@ -70,7 +70,7 @@ class HomePageVm @Inject constructor() : ViewModel() {
)
)
}
oldDbFile.exists()
oldDbFile.delete()
LogUtils.d("执行快照迁移")
}
}