reimplment ReadAsync for BlockFileDataStream/SubStream

This commit is contained in:
Stanley Dimant
2024-11-04 11:51:13 +01:00
parent 7acd36bb79
commit c80848fa2e
5 changed files with 128 additions and 77 deletions

View File

@@ -36,9 +36,9 @@ public class CacheController : ControllerBase
long requestSize = 0;
List<BlockFileDataSubstream> substreams = new();
foreach (var file in request.FileIds)
foreach (var fileHash in request.FileIds)
{
var fs = await _cachedFileProvider.GetAndDownloadFileStream(file);
var fs = await _cachedFileProvider.DownloadAndGetLocalFileInfo(fileHash).ConfigureAwait(false);
if (fs == null) continue;
substreams.Add(new(fs));