fix cancelled file uploads marked as verified, fix exception spam for portraits

This commit is contained in:
rootdarkarchon
2023-04-30 23:35:18 +02:00
parent dc48840352
commit dc1e1c044a
2 changed files with 9 additions and 3 deletions

View File

@@ -239,7 +239,9 @@ public class DalamudUtilService : IHostedService
{
if (_clientState.LocalPlayer?.IsDead ?? false) return;
_playerCharas = _performanceCollector.LogPerformance(this, "ObjTableToCharas", () => _objectTable.OfType<PlayerCharacter>().ToDictionary(p => p.GetHash256(), p => (p.Name.ToString(), p.Address), StringComparer.Ordinal));
_playerCharas = _performanceCollector.LogPerformance(this, "ObjTableToCharas",
() => _objectTable.OfType<PlayerCharacter>().Where(o => o.ObjectIndex < 240)
.ToDictionary(p => p.GetHash256(), p => (p.Name.ToString(), p.Address), StringComparer.Ordinal));
if (GposeTarget != null && !IsInGpose)
{

View File

@@ -156,14 +156,19 @@ public sealed class FileUploadManager : DisposableMediatorSubscriberBase
await UploadFileStream(compressedFile, fileHash, uploadToken).ConfigureAwait(false);
else
await UploadFileFull(compressedFile, fileHash, uploadToken).ConfigureAwait(false);
_verifiedUploadedHashes[fileHash] = DateTime.UtcNow;
}
catch (Exception ex)
{
if (!_mareConfigService.Current.UseAlternativeFileUpload)
if (!_mareConfigService.Current.UseAlternativeFileUpload && ex is not OperationCanceledException)
{
Logger.LogWarning(ex, "[{hash}] Error during file upload, trying alternative file upload", fileHash);
await UploadFileFull(compressedFile, fileHash, uploadToken).ConfigureAwait(false);
}
else
{
Logger.LogWarning(ex, "[{hash}] File upload cancelled", fileHash);
}
}
}
@@ -246,7 +251,6 @@ public sealed class FileUploadManager : DisposableMediatorSubscriberBase
await uploadTask.ConfigureAwait(false);
uploadTask = UploadFile(data.Item2, file.Hash, uploadToken);
uploadToken.ThrowIfCancellationRequested();
_verifiedUploadedHashes[file.Hash] = DateTime.UtcNow;
}
if (CurrentUploads.Any())