public List <ImportListItemInfo> Fetch() { var result = new List <ImportListItemInfo>(); var importLists = _importListFactory.AutomaticAddEnabled(); if (!importLists.Any()) { _logger.Debug("No enabled import lists, skipping."); return(result); } _logger.Debug("Available import lists {0}", importLists.Count); var taskList = new List <Task>(); var taskFactory = new TaskFactory(TaskCreationOptions.LongRunning, TaskContinuationOptions.None); foreach (var importList in importLists) { var importListLocal = importList; var task = taskFactory.StartNew(() => { try { var importListReports = importListLocal.Fetch(); lock (result) { _logger.Debug("Found {0} from {1}", importListReports.Count, importList.Name); result.AddRange(importListReports); } } catch (Exception e) { _logger.Error(e, "Error during Import List Sync"); } }).LogExceptions(); taskList.Add(task); } Task.WaitAll(taskList.ToArray()); result = result.DistinctBy(r => new { r.TvdbId, r.Title }).ToList(); _logger.Debug("Found {0} reports", result.Count); return(result); }