Skip to content

Commit

Permalink
Small Task.WaitAll change.
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent Guelfucci committed Oct 4, 2017
1 parent 10fdd3a commit cedc88e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Classifier.Outlook/core/mailprocessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,9 @@ private Task<bool> HandleTimer()
StopTimer();

// handle all the mail items
var tasks = new List<Task>();
foreach (var mailItem in _mailItems)
{
tasks.Add( HandleItem(mailItem ) );
}

// wait for all the tasks now.
Task.WaitAll(tasks.ToArray());
Task.WaitAll(_mailItems.Select(HandleItem).Cast<Task>().ToArray());

// clear the list.
_mailItems = new List<string>();
Expand Down

0 comments on commit cedc88e

Please sign in to comment.