mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 18:07:22 +01:00
requeue requests where files are still downloading
This commit is contained in:
parent
761a25c5fc
commit
6ab27d9698
1 changed files with 9 additions and 9 deletions
|
|
@ -169,30 +169,30 @@ public class RequestQueueService : IHostedService
|
|||
|
||||
while (true)
|
||||
{
|
||||
if (_priorityQueue.TryPeek(out var prioRequest))
|
||||
if (_priorityQueue.TryDequeue(out var prioRequest))
|
||||
{
|
||||
if (prioRequest.IsCancelled)
|
||||
{
|
||||
_priorityQueue.TryDequeue(out var _);
|
||||
continue;
|
||||
}
|
||||
if (_cachedFileProvider.AnyFilesDownloading(prioRequest.FileIds)) continue;
|
||||
|
||||
_priorityQueue.TryDequeue(out var priorityRequest);
|
||||
DequeueIntoSlot(priorityRequest, i);
|
||||
if (_cachedFileProvider.AnyFilesDownloading(prioRequest.FileIds))
|
||||
_priorityQueue.Enqueue(prioRequest);
|
||||
|
||||
DequeueIntoSlot(prioRequest, i);
|
||||
break;
|
||||
}
|
||||
|
||||
if (_queue.TryPeek(out var request))
|
||||
if (_queue.TryDequeue(out var request))
|
||||
{
|
||||
if (request.IsCancelled)
|
||||
{
|
||||
_queue.TryDequeue(out var _);
|
||||
continue;
|
||||
}
|
||||
if (_cachedFileProvider.AnyFilesDownloading(request.FileIds)) continue;
|
||||
|
||||
_queue.TryDequeue(out var priorityRequest);
|
||||
if (_cachedFileProvider.AnyFilesDownloading(request.FileIds))
|
||||
_queue.Enqueue(request);
|
||||
|
||||
DequeueIntoSlot(request, i);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue