Skip to content

Commit

Permalink
fix Bug 65299
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbannov committed Dec 5, 2023
1 parent 60e7c2e commit 2605e06
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,17 +403,18 @@ internal async Task CompressToZipAsync(Stream stream, IServiceScope scope)
compressTo.CreateEntry(newTitle, file.ModifiedOn);
try
{
if (await fileConverter.EnableConvertAsync(file, convertToExt))
await using var readStream = await fileConverter.EnableConvertAsync(file, convertToExt) ?
await fileConverter.ExecAsync(file, convertToExt) :
await fileDao.GetFileStreamAsync(file);

var t = Task.Run(async () => await compressTo.PutStream(readStream));

while (!t.IsCompleted)
{
//Take from converter
await using var readStream = await fileConverter.ExecAsync(file, convertToExt);
await compressTo.PutStream(readStream);
}
else
{
await using var readStream = await fileDao.GetFileStreamAsync(file);
await compressTo.PutStream(readStream);
PublishChanges();
await Task.Delay(100);
}

compressTo.CloseEntry();
}
catch (Exception ex)
Expand Down

0 comments on commit 2605e06

Please sign in to comment.