Skip to content

Commit

Permalink
fix: repair failed to load cloud disk file, no longer continue
Browse files Browse the repository at this point in the history
  • Loading branch information
trueai-org committed Jun 27, 2024
1 parent 3cc0aca commit 70b240b
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/MDriveSync.Core/Services/AliyunJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System.Data;
using System.Diagnostics;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -682,7 +681,7 @@ public async Task StartSyncJob(CancellationToken cancellationToken)
}

// 加载所有文件列表
AliyunDriveSearchFiles(_driveId);
AliyunDriveSearchFiles();

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

sw.Stop();
_log.LogInformation($"同步作业完成,用时:{sw.ElapsedMilliseconds}ms");

// 开始校验
sw.Restart();
_log.LogInformation($"同步作业结束:{DateTime.Now:G}");
ChangeState(JobState.Verifying);

await AliyunDriveVerify();

sw.Stop();
_log.LogInformation($"同步作业校验完成,用时:{sw.ElapsedMilliseconds}ms");

}
catch (Exception ex)
{
_log.LogError(ex, "同步作业完成执行异常");
throw ex;

Check warning on line 713 in src/MDriveSync.Core/Services/AliyunJob.cs

View workflow job for this annotation

GitHub Actions / 构建并发布 .NET 应用程序

Re-throwing caught exception changes stack information (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2200)

Check warning on line 713 in src/MDriveSync.Core/Services/AliyunJob.cs

View workflow job for this annotation

GitHub Actions / 构建并发布 .NET 应用程序

Re-throwing caught exception changes stack information (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2200)

Check warning on line 713 in src/MDriveSync.Core/Services/AliyunJob.cs

View workflow job for this annotation

GitHub Actions / 构建并发布 .NET 应用程序

Re-throwing caught exception changes stack information (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2200)
}

// 开始校验
sw.Restart();
_log.LogInformation($"同步作业结束:{DateTime.Now:G}");
ChangeState(JobState.Verifying);

await AliyunDriveVerify();

sw.Stop();
_log.LogInformation($"同步作业校验完成,用时:{sw.ElapsedMilliseconds}ms");

swAll.Stop();

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

// 所有文件列表
AliyunDriveSearchFiles(_driveId);
AliyunDriveSearchFiles();

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

Expand Down Expand Up @@ -2154,7 +2155,7 @@ await Parallel.ForEachAsync(addFileKeys, options, async (item, cancellationToken
/// <param name="driveId"></param>
/// <param name="limit"></param>
/// <returns></returns>
private void AliyunDriveSearchFiles(string driveId, int limit = 100)
private void AliyunDriveSearchFiles(int limit = 100)
{
try
{
Expand Down

0 comments on commit 70b240b

Please sign in to comment.