Fix a lot of the analyzer warnings too

This commit is contained in:
Loporrit
2025-06-30 17:50:31 +00:00
parent dd42bf0913
commit aa377439ce
46 changed files with 160 additions and 210 deletions

View File

@@ -182,27 +182,19 @@ public sealed class FileUploadManager : DisposableMediatorSubscriberBase
try
{
await UploadFileStream(compressedFile, fileHash, false, postProgress, uploadToken).ConfigureAwait(false);
await UploadFileStream(compressedFile, fileHash, munged: false, postProgress, uploadToken).ConfigureAwait(false);
_verifiedUploadedHashes[fileHash] = DateTime.UtcNow;
}
catch (Exception ex)
{
if (false && ex is not OperationCanceledException)
{
Logger.LogWarning(ex, "[{hash}] Error during file upload, trying alternative file upload", fileHash);
await UploadFileStream(compressedFile, fileHash, munged: true, postProgress, uploadToken).ConfigureAwait(false);
}
else
{
Logger.LogWarning(ex, "[{hash}] File upload cancelled", fileHash);
}
Logger.LogWarning(ex, "[{hash}] File upload cancelled", fileHash);
}
}
private async Task UploadFileStream(byte[] compressedFile, string fileHash, bool munged, bool postProgress, CancellationToken uploadToken)
{
if (munged)
throw new NotImplementedException();
throw new InvalidOperationException();
using var ms = new MemoryStream(compressedFile);