Skip to content

Commit

Permalink
Undo progress download status changes
Browse files Browse the repository at this point in the history
  • Loading branch information
duduita committed Aug 1, 2023
1 parent 1079089 commit 6c086c9
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions source/Meadow.Core/Update/UpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,24 +411,9 @@ private async Task DownloadProc(UpdateMessage message)
{
Resolver.Log.Trace($"Copying update to {fileStream.Name}");

var bufferSize = 4096;
var totalBytesRead = 0L;
var buffer = new byte[bufferSize];
var bytesRead = 0;

do
{
bytesRead = await stream.ReadAsync(buffer, 0, bufferSize);
await fileStream.WriteAsync(buffer, 0, bytesRead);
totalBytesRead += bytesRead;

var progressPercentage = (double)totalBytesRead / stream.Length;
Console.WriteLine("Downloading progress:" + progressPercentage);

} while (bytesRead > 0);
await stream.CopyToAsync(fileStream, 4096);
}
}

}

sw.Stop();
Expand Down

0 comments on commit 6c086c9

Please sign in to comment.