Example #1
0
        private void SwapToNextQueue(QueueWrapper newQueue)
        {
            _logger.LogDebug($"Switching to new queue with {newQueue.Queue.Count} items");

            var oldQueue = _fetchQueue;

            _fetchQueue = newQueue;
            oldQueue.CancellationTokenSource.Cancel();
        }
Example #2
0
        private QueueWrapper PrepareNextQueue(SourceSeriesList sourceSeriesList)
        {
            var fetches = ListToFetches(sourceSeriesList);
            //fetches.Shuffle(); // Randomise the fetch order so we aren't always prioritising the same series

            var queue = new QueueWrapper();

            foreach (var ingestionFetch in fetches)
            {
                queue.Queue.Add(ingestionFetch);
            }
            return(queue);
        }