Skip to content

Commit 1ce4868

Browse files
committed
减少异步方法,换成尝试读取方法
1 parent d989b49 commit 1ce4868

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/dotnetCampus.FileDownloader/DownloadByHttpClient/SegmentFileDownloaderByHttpClient.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,12 @@ private async ValueTask DownloadTask()
573573
return;
574574
}
575575

576-
data = await DownloadDataList.Reader.ReadAsync().ConfigureAwait(false);
576+
if (!DownloadDataList.Reader.TryRead(out data))
577+
{
578+
// 居然读取不到数据,那就再次进入循环吧
579+
continue;
580+
}
581+
577582
Interlocked.Decrement(ref _workTaskCount);
578583
}
579584
catch (ChannelClosedException)

0 commit comments

Comments
 (0)