fix(browser): 占用转待办路径误删暂存目录导致 ENOENT
This commit is contained in:
@@ -324,10 +324,11 @@ export async function importBrowserProfile(sourceId: string, profileDir: string)
|
||||
try {
|
||||
applyStagedToPartition(staging)
|
||||
} catch (err) {
|
||||
rmSync(staging, { recursive: true, force: true })
|
||||
if (!isLockError(err)) {
|
||||
rmSync(staging, { recursive: true, force: true })
|
||||
throw new Error(`导入写入失败: ${err instanceof Error ? err.message : String(err)}`)
|
||||
}
|
||||
// 占用错误:暂存目录保留,写 meta 后整体 rename 到 pending
|
||||
const deferredNote = '检测到受管浏览器数据正被本应用占用,已计划在重启应用后自动完成导入。'
|
||||
mkdirSync(join(app.getPath('userData'), 'Partitions'), { recursive: true })
|
||||
rmSync(pendingDir(), { recursive: true, force: true })
|
||||
|
||||
Reference in New Issue
Block a user