Skip to content

Commit 70b240b

Browse files
committed
fix: repair failed to load cloud disk file, no longer continue
1 parent 3cc0aca commit 70b240b

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/MDriveSync.Core/Services/AliyunJob.cs

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using System.Data;
1212
using System.Diagnostics;
1313
using System.Net;
14-
using System.Runtime.InteropServices;
1514
using System.Text;
1615
using System.Text.Json;
1716
using System.Text.RegularExpressions;
@@ -682,7 +681,7 @@ public async Task StartSyncJob(CancellationToken cancellationToken)
682681
}
683682

684683
// 加载所有文件列表
685-
AliyunDriveSearchFiles(_driveId);
684+
AliyunDriveSearchFiles();
686685

687686
// 加载备份文件夹下的所有文件夹
688687
//await FetchAllFilesAsync(_driveId, saveParentFileId, 100);
@@ -696,22 +695,24 @@ public async Task StartSyncJob(CancellationToken cancellationToken)
696695

697696
sw.Stop();
698697
_log.LogInformation($"同步作业完成,用时:{sw.ElapsedMilliseconds}ms");
698+
699+
// 开始校验
700+
sw.Restart();
701+
_log.LogInformation($"同步作业结束:{DateTime.Now:G}");
702+
ChangeState(JobState.Verifying);
703+
704+
await AliyunDriveVerify();
705+
706+
sw.Stop();
707+
_log.LogInformation($"同步作业校验完成,用时:{sw.ElapsedMilliseconds}ms");
708+
699709
}
700710
catch (Exception ex)
701711
{
702712
_log.LogError(ex, "同步作业完成执行异常");
713+
throw ex;
703714
}
704715

705-
// 开始校验
706-
sw.Restart();
707-
_log.LogInformation($"同步作业结束:{DateTime.Now:G}");
708-
ChangeState(JobState.Verifying);
709-
710-
await AliyunDriveVerify();
711-
712-
sw.Stop();
713-
_log.LogInformation($"同步作业校验完成,用时:{sw.ElapsedMilliseconds}ms");
714-
715716
swAll.Stop();
716717

717718
ProcessMessage = $"执行完成,总用时 {swAll.ElapsedMilliseconds / 1000} 秒";
@@ -875,7 +876,7 @@ public async Task StartRestore()
875876
_log.LogInformation("加载云盘存储文件列表...");
876877

877878
// 所有文件列表
878-
AliyunDriveSearchFiles(_driveId);
879+
AliyunDriveSearchFiles();
879880

880881
//await FetchAllFilesAsync(_driveId, saveParentFileId, 100);
881882

@@ -2154,7 +2155,7 @@ await Parallel.ForEachAsync(addFileKeys, options, async (item, cancellationToken
21542155
/// <param name="driveId"></param>
21552156
/// <param name="limit"></param>
21562157
/// <returns></returns>
2157-
private void AliyunDriveSearchFiles(string driveId, int limit = 100)
2158+
private void AliyunDriveSearchFiles(int limit = 100)
21582159
{
21592160
try
21602161
{

0 commit comments

Comments
 (0)