Skip to content

Commit

Permalink
opti: 调整进度条部分代码写法
Browse files Browse the repository at this point in the history
  • Loading branch information
SALTWOOD committed May 26, 2024
1 parent 0cf9c74 commit 0e551e5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions CSharp-OpenBMCLAPI/Modules/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,16 +463,6 @@ protected async Task CheckFiles(bool skipCheck, FileVerificationMode mode)
}
}, source.Token);

_ = Task.Run(() =>
{
while (true)
{
downloadMessage.Clear();
source.Token.ThrowIfCancellationRequested();
Thread.Sleep(10000);
}
}, source.Token);

Parallel.ForEach(files, file =>
//foreach (var file in files)
{
Expand All @@ -483,6 +473,9 @@ protected async Task CheckFiles(bool skipCheck, FileVerificationMode mode)
}
});

downloadProgress.Clear();
downloadMessage.Clear();

source.Cancel();

files = null!;
Expand Down

0 comments on commit 0e551e5

Please sign in to comment.