diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-08 15:22:40 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-08 15:22:40 -0500 |
| commit | 3ffd95a6371c40246a8163c17da3626374685271 (patch) | |
| tree | ec8edbd7fb21337b495924ec587a9e8cce355968 /MediaBrowser.Controller/Entities/Folder.cs | |
| parent | d0f1a836216e87d6e03c7c3ebdbd78c0e7ddcf76 (diff) | |
minor cleanup
Diffstat (limited to 'MediaBrowser.Controller/Entities/Folder.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 25197be675..8fae9629be 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -518,7 +518,7 @@ namespace MediaBrowser.Controller.Entities foreach (var child in children) { - if (tasks.Count > 5) + if (tasks.Count >= 2) { await Task.WhenAll(tasks).ConfigureAwait(false); tasks.Clear(); @@ -596,15 +596,8 @@ namespace MediaBrowser.Controller.Entities var percentages = new Dictionary<Guid, double>(list.Count); - var tasks = new List<Task>(); - foreach (var item in list) { - if (tasks.Count > 10) - { - await Task.WhenAll(tasks).ConfigureAwait(false); - } - cancellationToken.ThrowIfCancellationRequested(); var child = item; @@ -624,12 +617,9 @@ namespace MediaBrowser.Controller.Entities } }); - tasks.Add(child.ValidateChildrenWithCancellationSupport(innerProgress, cancellationToken, true, false, null)); + await child.ValidateChildrenWithCancellationSupport(innerProgress, cancellationToken, true, false, null) + .ConfigureAwait(false); } - - cancellationToken.ThrowIfCancellationRequested(); - - await Task.WhenAll(tasks).ConfigureAwait(false); } /// <summary> |
