mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 15:07:22 +01:00
make sure to resend the data
This commit is contained in:
parent
a1193875a5
commit
b9ef6503d2
3 changed files with 13 additions and 2 deletions
|
|
@ -126,8 +126,17 @@ public class FileTransferOrchestrator : DisposableMediatorSubscriberBase
|
|||
MareConfiguration.Models.DownloadSpeeds.MBps => limit * 1024 * 1024,
|
||||
_ => limit,
|
||||
};
|
||||
var dividedLimit = limit / (CurrentlyUsedDownloadSlots == 0 ? 1 : CurrentlyUsedDownloadSlots);
|
||||
return dividedLimit == 0 ? 1 : dividedLimit;
|
||||
var currentUsedDlSlots = CurrentlyUsedDownloadSlots;
|
||||
var avaialble = _availableDownloadSlots;
|
||||
var currentCount = _downloadSemaphore.CurrentCount;
|
||||
var dividedLimit = limit / (currentUsedDlSlots == 0 ? 1 : currentUsedDlSlots);
|
||||
if (dividedLimit < 0)
|
||||
{
|
||||
Logger.LogWarning("Calculated Bandwidth Limit is negative, returning Infinity: {value}, CurrentlyUsedDownloadSlots is {currentSlots}, " +
|
||||
"DownloadSpeedLimit is {limit}, available slots: {avail}, current count: {count}", dividedLimit, currentUsedDlSlots, limit, avaialble, currentCount);
|
||||
return long.MaxValue;
|
||||
}
|
||||
return Math.Clamp(dividedLimit, 1, long.MaxValue);
|
||||
}
|
||||
|
||||
private async Task<HttpResponseMessage> SendRequestInternalAsync(HttpRequestMessage requestMessage,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ public partial class ApiController
|
|||
|
||||
try
|
||||
{
|
||||
Logger.LogDebug("Pushing Character data {hash} to {visible}", data.DataHash, string.Join(", ", visibleCharacters.Select(v => v.AliasOrUID)));
|
||||
await PushCharacterDataInternal(data, [.. visibleCharacters]).ConfigureAwait(false);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
|
|
|
|||
|
|
@ -406,6 +406,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
|||
}
|
||||
await LoadIninitialPairs().ConfigureAwait(false);
|
||||
await LoadOnlinePairs().ConfigureAwait(false);
|
||||
Mediator.Publish(new ConnectedMessage(_connectionDto));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue