修复失败和取消以外多余的1s等待

This commit is contained in:
camileko
2026-09-21 01:06:18 +08:00
parent 8f76864574
commit 6d5c73fe98
@@ -1814,8 +1814,8 @@ Retry:
End Sub
Public Sub McInstallFailedClearFolder(Loader)
Try
If Loader.State <> LoadState.Failed AndAlso Loader.State <> LoadState.Canceled Then Return
Thread.Sleep(1000) '防止存在尚未完全释放的文件,导致清理失败(例如整合包安装)
If Loader.State = LoadState.Failed OrElse Loader.State = LoadState.Canceled Then
'删除版本文件夹
If DirectoryUtils.Exists(Loader.Input & "saves\") OrElse DirectoryUtils.Exists(Loader.Input & "versions\") Then
Logger.Warn($"由于版本已被独立启动,不清理版本文件夹:{Loader.Input}")
@@ -1823,7 +1823,6 @@ Retry:
Logger.Warn($"由于下载失败或取消,清理版本文件夹:{Loader.Input}")
DirectoryUtils.Delete(Loader.Input)
End If
End If
Catch ex As Exception
Logger.Warn(ex, "下载失败或取消后清理版本文件夹失败")
End Try