Skip to content

Commit 43bb2b3

Browse files
author
Fastace
committed
perf(restic): 备份准备阶段不再重复执行全库 check,修复点继续后分钟级等待
一、现象与实测 真机路径:首页 → 备份应用 → 选择应用 → 继续 → 自动息屏引导页 → 继续, 点「继续」后长时间无响应。用 adb logcat --pid=<app pid> -v threadtime 抓到的 分段耗时(云端 COS 账户): - 15:20:50.552 testConnection(opendal) → 15:21:50.257 WakeLock acquired:59.7s 空白 - 15:21:50.305 WakeLock acquired → 15:22:03.596 Preprocessing is starting.:13.3s 空白 - 15:22:03.780 mkdir(opendal): 777/configs → 15:23:00.933 Processing is starting.:57.2s 空白 - Processing is starting. 之后 onProcessing() 还有同量级的第三次检查 约 3 分钟全部花在「第一个应用开始打包」之前。云端 checkCosRepository 成功路径 一行日志都不打,所以用户侧只看到转圈,无法归因。 二、根因 1. verifyRepository / 云端 checkRepository 的第三步 checkRusticRepository 落到 native repo.check(...),会 get_all_snapshots() 后遍历全部快照树与 index;在对象 存储上意味着成百上千次远程列举与读取,仓库越大越慢。该逻辑由 5eabb42 引入, 早期仓库小几乎无感,与「历史版本没有这个问题」一致。项目里本地引导页已明确 删掉这一步(feature/setup/page/two/IndexViewModel.kt:286 注释写着「几十 GB 的 仓库要跑几分钟,用户看到的就是一直转圈」),但备份链路没有同步收敛。 2. 同一个仓库在一次备份里被检查 3 次:FinishSetup(BackupViewModelImpl)、 onTargetDirsCreated(BackupServiceCloudImpl)、onProcessing(AbstractBackupService)。 每次都是完整远程全库 check,等于把单次开销放大三倍。 3. 次要:onInitializing() 逐包 getPackageInfoAsUser + loadLabel + getPermissions 耗时 13.3s 且整段没有日志,是第二个诊断盲区。 三、修复 1. 前置检查降级:CloudResticBackend.checkRepository 新增 fullCheck: Boolean = true,8 个云端后端(COS / AWS S3 / OSS / OBS / WebDAV / SMB / SFTP / FTP)统一把第三步全库 check 包进 if (fullCheck)。默认 true, 云账户添加/校验等未改调用点仍是完整检查。本地 ResticRepository.verifyRepository 同样加参数,false 时 exists + validate 通过即返回并打一行日志。 2. 备份前置的 6 个检查点全部传 fullCheck = false:packages / medium 的本地、 云端、OTG onPreBackupRepositoryCheck,以及两个 Setup 页的 FinishSetup、 hasOtg flow、bootstrapOtg。 3. 去重:删掉 onProcessing() 开头的第二次 onPreBackupRepositoryCheck,只保留 onTargetDirsCreated() 那一次;云端 FinishSetup 只留 testConnection() 验证网络 与凭据;本地 / OTG FinishSetup 保留 fail-fast 但降级为轻量校验(OTG 分支还承担 任务级标记复位与错误提示,不宜整段删除)。 4. 诊断留痕:checkCosRepository 三步各打 elapsed 与 fullCheck 取值, onInitializing() 打开始、逐包 packageName took=...ms、汇总耗时, 消掉此前的零日志黑洞。 四、验证 - 真机复测:用户确认「目前正确」,准备阶段的分钟级等待已消除。 - 编译::core:restic / :core:service / :feature:main:processing / :feature:main:cloud / :app:compileArm64-v8aPremiumDebugKotlin --offline BUILD SUCCESSFUL(3m13s);后续两次增量编译同样成功。 - 打包::app:assembleArm64-v8aFossDebug --offline BUILD SUCCESSFUL(42s, 142.8MB,内嵌预编译 native 库,本次未改 native,无需重跑 build-jni)。 - read_lints 0 诊断;git diff --check 干净;18 files, +111 -91。 - 签名变更:仅 checkRepository 与 verifyRepository 各新增一个带默认值的参数, 8 个实现同步,默认值保证未改调用点行为不变,全量重编覆盖下游。 - 影响面:impact CloudResticBackend.checkRepository = HIGH(9 direct / 13 impacted / 3 modules)、onPreBackupRepositoryCheck = LOW(1 direct)、 onInitializing = UNKNOWN(图谱解析不到调用方,已用文本搜索确认唯一调用点是 AbstractProcessingService.initialize():332)。detect_changes scope=all = 18 files / 70 symbols / 7 flows / risk high,属云后端中枢接口枚举扩散的虚报; 索引 stale(indexed a23883f / HEAD 29e4556),结论以源码与全量编译为准。 五、有意不改的部分 - 设置页 / 恢复页 / 首页 / 云账户添加页的仓库检查保持默认全量,作为 「手动完整性检查」入口,符合方案里「全库 check 留在手动维护」的口径。 - 非 FD 路径 backupWithRestic(packages/backup/AbstractBackupService.kt:616、 medium/backup/AbstractBackupService.kt:265)每个包 / 文件前仍调 resticRepo.checkRepository 全库 check;本次实测走 FD 流未经过,留待后续收敛。 - CloudRepository 把全部账户 AK/SK 与明文密码打到 E 级 logcat 的问题未动, 安全整改单独处理。 - 两个 BackupViewModelImpl 的私有 backend() helper 现在无调用点(仅编译器 warning),未删以免牵动 Hilt 构造参数。
1 parent 29e4556 commit 43bb2b3

18 files changed

Lines changed: 111 additions & 91 deletions

File tree

‎source/core/restic/src/main/kotlin/com/xayah/core/restic/CloudResticBackend.kt‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@ interface CloudResticBackend {
1313
cloudEntity: CloudEntity, remotePath: String, password: String
1414
): Result<String>
1515

16+
/**
17+
* 仓库可用性检查。
18+
*
19+
* [fullCheck] = true(默认):exists + validate + 全库完整性 check,用于账户校验 / 手动维护;
20+
* [fullCheck] = false:只做 exists + validate,用于**每次备份的前置检查**。
21+
*
22+
* 全库 check 会遍历全部快照树与 index,在对象存储上意味着成百上千次远程 IO,
23+
* 仓库越大越慢(实测几十秒~几分钟),绝不能放在备份启动路径上。
24+
*/
1625
suspend fun checkRepository(
17-
cloudEntity: CloudEntity, password: String
26+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean = true
1827
): Result<Unit>
1928

2029
suspend fun backupFile(

‎source/core/restic/src/main/kotlin/com/xayah/core/restic/ResticRepository.kt‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ class ResticRepository @Inject constructor(
458458
* - check:validate 通过后再做完整性检查,覆盖"仓库损坏"。
459459
* 任一不通过即返回 false。
460460
*/
461-
suspend fun verifyRepository(repoPath: String, password: String): Boolean {
461+
suspend fun verifyRepository(repoPath: String, password: String, fullCheck: Boolean = true): Boolean {
462462
val exists = rootService.rusticRepositoryExists(repoPath)
463463
if (!exists) {
464464
Log.w(TAG, "verifyRepository: repository 不存在(未初始化/config 缺失): $repoPath")
@@ -469,6 +469,12 @@ class ResticRepository @Inject constructor(
469469
Log.w(TAG, "verifyRepository: validate 未通过(config 缺失/密码错): $repoPath")
470470
return false
471471
}
472+
// 备份前置检查传 fullCheck=false:validate 已证明 key 正确、仓库可打开,
473+
// 全库 check 属于维护工具,不该卡在每次备份的启动路径上。
474+
if (!fullCheck) {
475+
Log.i(TAG, "verifyRepository: validate passed, full check skipped (pre-backup fast path): $repoPath")
476+
return true
477+
}
472478
val ok = checkRepository(repoPath, password)
473479
if (!ok) {
474480
Log.w(TAG, "verifyRepository: check 未通过(仓库损坏): $repoPath")

‎source/core/restic/src/main/kotlin/com/xayah/core/restic/ResticRepositoryAliyunOss.kt‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ResticRepositoryAliyunOss @Inject constructor(
4343
}
4444

4545
override suspend fun checkRepository(
46-
cloudEntity: CloudEntity, password: String
46+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean
4747
): Result<Unit> = withContext(Dispatchers.IO) {
4848
try {
4949
val extra = ResticShared.json.decodeFromString<AliyunOssExtra>(cloudEntity.extra)
@@ -55,8 +55,11 @@ class ResticRepositoryAliyunOss @Inject constructor(
5555
val validate = shared.rootService.validateRusticRepository("opendal:oss", password, options)
5656
if (validate.isFailure) return@withContext Result.failure(validate.exceptionOrNull() ?: Exception("仓库密码错误或无法打开"))
5757

58-
val check = shared.rootService.checkRusticRepository("opendal:oss", password, options)
59-
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
58+
// 全库 check 仅在手动维护 / 账户校验时执行;备份前置检查传 fullCheck=false 跳过
59+
if (fullCheck) {
60+
val check = shared.rootService.checkRusticRepository("opendal:oss", password, options)
61+
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
62+
}
6063

6164
Result.success(Unit)
6265
} catch (e: Exception) {

‎source/core/restic/src/main/kotlin/com/xayah/core/restic/ResticRepositoryAwsS3.kt‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ResticRepositoryAwsS3 @Inject constructor(
5555
}
5656

5757
override suspend fun checkRepository(
58-
cloudEntity: CloudEntity, password: String
58+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean
5959
): Result<Unit> = withContext(Dispatchers.IO) {
6060
try {
6161
val extra = ResticShared.json.decodeFromString<AwsS3Extra>(cloudEntity.extra)
@@ -67,8 +67,11 @@ class ResticRepositoryAwsS3 @Inject constructor(
6767
val validate = shared.rootService.validateRusticRepository("opendal:s3", password, options)
6868
if (validate.isFailure) return@withContext Result.failure(validate.exceptionOrNull() ?: Exception("仓库密码错误或无法打开"))
6969

70-
val check = shared.rootService.checkRusticRepository("opendal:s3", password, options)
71-
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
70+
// 全库 check 仅在手动维护 / 账户校验时执行;备份前置检查传 fullCheck=false 跳过
71+
if (fullCheck) {
72+
val check = shared.rootService.checkRusticRepository("opendal:s3", password, options)
73+
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
74+
}
7275

7376
Result.success(Unit)
7477
} catch (e: Exception) {

‎source/core/restic/src/main/kotlin/com/xayah/core/restic/ResticRepositoryCos.kt‎

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class ResticRepositoryCos @Inject constructor(
6060
}
6161

6262
override suspend fun checkRepository(
63-
cloudEntity: CloudEntity, password: String
64-
): Result<Unit> = checkCosRepository(cloudEntity, password)
63+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean
64+
): Result<Unit> = checkCosRepository(cloudEntity, password, fullCheck)
6565

6666
// backupFileToCos —— 对应 backupFileToS3,返回 Pair<Int,String>(保持上层契约)
6767
override suspend fun backupFile(
@@ -170,23 +170,37 @@ class ResticRepositoryCos @Inject constructor(
170170
// ==================== COS 专用实现(保留原方法名,供既有调用点使用) ====================
171171

172172
suspend fun checkCosRepository(
173-
cloudEntity: CloudEntity, password: String
173+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean = true
174174
): Result<Unit> = withContext(Dispatchers.IO) {
175+
// 备份前置检查曾卡在第 3 步全库 check(数十秒~数分钟且成功路径无日志),逐段计时留痕
176+
var mark = System.currentTimeMillis()
177+
fun elapsed(step: String) {
178+
val now = System.currentTimeMillis()
179+
Log.i(ResticShared.TAG, "checkCosRepository step=$step elapsed=${now - mark}ms fullCheck=$fullCheck")
180+
mark = now
181+
}
175182
try {
176183
val extra = ResticShared.json.decodeFromString<S3Extra>(cloudEntity.extra)
177184
val options = buildS3BackendOptions(extra, cloudEntity.remote)
178185

179186
// 1) 存在性门槛(返回真实 bool,不依赖异常)
180187
val exists = shared.rootService.rusticRepositoryExists("opendal:cos", options)
188+
elapsed("exists")
181189
if (!exists) return@withContext Result.failure(Exception("仓库不存在或不可访问"))
182190

183191
// 2) validate(密码/可打开)
184192
val validate = shared.rootService.validateRusticRepository("opendal:cos", password, options)
193+
elapsed("validate")
185194
if (validate.isFailure) return@withContext Result.failure(validate.exceptionOrNull() ?: Exception("仓库密码错误或无法打开"))
186195

187-
// 3) check(完整性/损坏)
188-
val check = shared.rootService.checkRusticRepository("opendal:cos", password, options)
189-
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
196+
// 3) check(完整性/损坏):仅手动维护 / 账户校验才跑,备份前置检查跳过
197+
if (fullCheck) {
198+
val check = shared.rootService.checkRusticRepository("opendal:cos", password, options)
199+
elapsed("fullCheck")
200+
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
201+
} else {
202+
elapsed("fullCheck(skipped)")
203+
}
190204

191205
Result.success(Unit)
192206
} catch (e: Exception) {

‎source/core/restic/src/main/kotlin/com/xayah/core/restic/ResticRepositoryFtp.kt‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class ResticRepositoryFtp @Inject constructor(
5656
}
5757

5858
override suspend fun checkRepository(
59-
cloudEntity: CloudEntity, password: String
60-
): Result<Unit> = checkFtpRepository(cloudEntity, password)
59+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean
60+
): Result<Unit> = checkFtpRepository(cloudEntity, password, fullCheck)
6161

6262
override suspend fun backupFile(
6363
cloudEntity: CloudEntity, remotePath: String, filePath: String,
@@ -147,7 +147,7 @@ class ResticRepositoryFtp @Inject constructor(
147147
}
148148

149149
suspend fun checkFtpRepository(
150-
cloudEntity: CloudEntity, password: String
150+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean = true
151151
): Result<Unit> = withContext(Dispatchers.IO) {
152152
val session = startServe(cloudEntity, cloudEntity.remote)
153153
try {
@@ -157,8 +157,11 @@ class ResticRepositoryFtp @Inject constructor(
157157
val validate = shared.rootService.validateRusticRepository(session.restUrl, password, emptyMap())
158158
if (validate.isFailure) return@withContext Result.failure(validate.exceptionOrNull() ?: Exception("仓库密码错误或无法打开"))
159159

160-
val check = shared.rootService.checkRusticRepository(session.restUrl, password, emptyMap())
161-
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
160+
// 全库 check 仅在手动维护 / 账户校验时执行;备份前置检查传 fullCheck=false 跳过
161+
if (fullCheck) {
162+
val check = shared.rootService.checkRusticRepository(session.restUrl, password, emptyMap())
163+
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
164+
}
162165

163166
Result.success(Unit)
164167
} catch (e: Exception) {

‎source/core/restic/src/main/kotlin/com/xayah/core/restic/ResticRepositoryHuaweiObs.kt‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ResticRepositoryHuaweiObs @Inject constructor(
4242
}
4343

4444
override suspend fun checkRepository(
45-
cloudEntity: CloudEntity, password: String
45+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean
4646
): Result<Unit> = withContext(Dispatchers.IO) {
4747
try {
4848
val extra = ResticShared.json.decodeFromString<HuaweiObsExtra>(cloudEntity.extra)
@@ -54,8 +54,11 @@ class ResticRepositoryHuaweiObs @Inject constructor(
5454
val validate = shared.rootService.validateRusticRepository("opendal:obs", password, options)
5555
if (validate.isFailure) return@withContext Result.failure(validate.exceptionOrNull() ?: Exception("仓库密码错误或无法打开"))
5656

57-
val check = shared.rootService.checkRusticRepository("opendal:obs", password, options)
58-
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
57+
// 全库 check 仅在手动维护 / 账户校验时执行;备份前置检查传 fullCheck=false 跳过
58+
if (fullCheck) {
59+
val check = shared.rootService.checkRusticRepository("opendal:obs", password, options)
60+
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
61+
}
5962

6063
Result.success(Unit)
6164
} catch (e: Exception) {

‎source/core/restic/src/main/kotlin/com/xayah/core/restic/ResticRepositorySftp.kt‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class ResticRepositorySftp @Inject constructor(
5555
}
5656

5757
override suspend fun checkRepository(
58-
cloudEntity: CloudEntity, password: String
59-
): Result<Unit> = checkSftpRepository(cloudEntity, password)
58+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean
59+
): Result<Unit> = checkSftpRepository(cloudEntity, password, fullCheck)
6060

6161
override suspend fun backupFile(
6262
cloudEntity: CloudEntity, remotePath: String, filePath: String,
@@ -146,7 +146,7 @@ class ResticRepositorySftp @Inject constructor(
146146
}
147147

148148
suspend fun checkSftpRepository(
149-
cloudEntity: CloudEntity, password: String
149+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean = true
150150
): Result<Unit> = withContext(Dispatchers.IO) {
151151
val session = startServe(cloudEntity, cloudEntity.remote)
152152
try {
@@ -156,8 +156,11 @@ class ResticRepositorySftp @Inject constructor(
156156
val validate = shared.rootService.validateRusticRepository(session.restUrl, password, emptyMap())
157157
if (validate.isFailure) return@withContext Result.failure(validate.exceptionOrNull() ?: Exception("仓库密码错误或无法打开"))
158158

159-
val check = shared.rootService.checkRusticRepository(session.restUrl, password, emptyMap())
160-
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
159+
// 全库 check 仅在手动维护 / 账户校验时执行;备份前置检查传 fullCheck=false 跳过
160+
if (fullCheck) {
161+
val check = shared.rootService.checkRusticRepository(session.restUrl, password, emptyMap())
162+
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
163+
}
161164

162165
Result.success(Unit)
163166
} catch (e: Exception) {

‎source/core/restic/src/main/kotlin/com/xayah/core/restic/ResticRepositorySmb.kt‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class ResticRepositorySmb @Inject constructor(
5353
}
5454

5555
override suspend fun checkRepository(
56-
cloudEntity: CloudEntity, password: String
57-
): Result<Unit> = checkSmbRepository(cloudEntity, password)
56+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean
57+
): Result<Unit> = checkSmbRepository(cloudEntity, password, fullCheck)
5858

5959
override suspend fun backupFile(
6060
cloudEntity: CloudEntity, remotePath: String, filePath: String,
@@ -143,7 +143,7 @@ class ResticRepositorySmb @Inject constructor(
143143
}
144144

145145
suspend fun checkSmbRepository(
146-
cloudEntity: CloudEntity, password: String
146+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean = true
147147
): Result<Unit> = withContext(Dispatchers.IO) {
148148
val session = startServe(cloudEntity, cloudEntity.remote)
149149
try {
@@ -153,8 +153,11 @@ class ResticRepositorySmb @Inject constructor(
153153
val validate = shared.rootService.validateRusticRepository(session.restUrl, password, emptyMap())
154154
if (validate.isFailure) return@withContext Result.failure(validate.exceptionOrNull() ?: Exception("仓库密码错误或无法打开"))
155155

156-
val check = shared.rootService.checkRusticRepository(session.restUrl, password, emptyMap())
157-
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
156+
// 全库 check 仅在手动维护 / 账户校验时执行;备份前置检查传 fullCheck=false 跳过
157+
if (fullCheck) {
158+
val check = shared.rootService.checkRusticRepository(session.restUrl, password, emptyMap())
159+
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
160+
}
158161

159162
Result.success(Unit)
160163
} catch (e: Exception) {

‎source/core/restic/src/main/kotlin/com/xayah/core/restic/ResticRepositoryWebdav.kt‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class ResticRepositoryWebdav @Inject constructor(
4040
}
4141

4242
override suspend fun checkRepository(
43-
cloudEntity: CloudEntity, password: String
44-
): Result<Unit> = checkWebdavRepository(cloudEntity, password)
43+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean
44+
): Result<Unit> = checkWebdavRepository(cloudEntity, password, fullCheck)
4545

4646
override suspend fun backupFile(
4747
cloudEntity: CloudEntity, remotePath: String, filePath: String,
@@ -124,7 +124,7 @@ class ResticRepositoryWebdav @Inject constructor(
124124
}
125125

126126
suspend fun checkWebdavRepository(
127-
cloudEntity: CloudEntity, password: String
127+
cloudEntity: CloudEntity, password: String, fullCheck: Boolean = true
128128
): Result<Unit> = withContext(Dispatchers.IO) {
129129
try {
130130
val options = buildWebdavBackendOptions(cloudEntity, cloudEntity.remote)
@@ -136,8 +136,11 @@ class ResticRepositoryWebdav @Inject constructor(
136136
val validate = shared.rootService.validateRusticRepository("opendal:webdav", password, options)
137137
if (validate.isFailure) return@withContext Result.failure(validate.exceptionOrNull() ?: Exception("仓库密码错误或无法打开"))
138138

139-
val check = shared.rootService.checkRusticRepository("opendal:webdav", password, options)
140-
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
139+
// 全库 check 仅在手动维护 / 账户校验时执行;备份前置检查传 fullCheck=false 跳过
140+
if (fullCheck) {
141+
val check = shared.rootService.checkRusticRepository("opendal:webdav", password, options)
142+
if (check.isFailure) return@withContext Result.failure(check.exceptionOrNull() ?: Exception("仓库损坏"))
143+
}
141144

142145
Result.success(Unit)
143146
} catch (e: Exception) { Log.e(ResticShared.TAG, "checkWebdavRepository 异常", e); Result.failure(e) }

0 commit comments

Comments
 (0)