fixes uploads cancelling early
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 rootdarkarchon
					rootdarkarchon