mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 20:07:21 +01:00
fixes uploads cancelling early
This commit is contained in:
parent
56dd3c2f65
commit
605c1d3774
2 changed files with 3 additions and 12 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<PropertyGroup>
|
||||
<Authors></Authors>
|
||||
<Company></Company>
|
||||
<Version>0.5.7</Version>
|
||||
<Version>0.5.8</Version>
|
||||
<Description></Description>
|
||||
<Copyright></Copyright>
|
||||
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
||||
|
|
|
|||
|
|
@ -239,22 +239,13 @@ public partial class ApiController
|
|||
Logger.Debug($"Compressed {totalSize} to {compressedSize} ({(compressedSize / (double)totalSize):P2})");
|
||||
|
||||
Logger.Debug("Upload tasks complete, waiting for server to confirm");
|
||||
var anyUploadsOpen = await FilesIsUploadFinished().ConfigureAwait(false);
|
||||
Logger.Debug("Uploads open: " + anyUploadsOpen);
|
||||
double timeWaited = 0;
|
||||
Logger.Debug("Uploads open: " + CurrentUploads.Any(c => c.IsInTransfer));
|
||||
const double waitStep = 1.0d;
|
||||
while (anyUploadsOpen && !uploadToken.IsCancellationRequested && timeWaited < 5)
|
||||
while (CurrentUploads.Any(c => c.IsInTransfer) && !uploadToken.IsCancellationRequested)
|
||||
{
|
||||
anyUploadsOpen = await FilesIsUploadFinished().ConfigureAwait(false);
|
||||
timeWaited += waitStep;
|
||||
await Task.Delay(TimeSpan.FromSeconds(waitStep), uploadToken).ConfigureAwait(false);
|
||||
Logger.Debug("Waiting for uploads to finish");
|
||||
}
|
||||
|
||||
if(timeWaited > waitStep)
|
||||
{
|
||||
await FilesAbortUpload().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in unverifiedUploadHashes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue