made inbox processing more async
This commit is contained in:
parent
e7197f3054
commit
a9b3bc8da9
1 changed files with 19 additions and 13 deletions
|
@ -63,8 +63,11 @@ namespace BirdsiteLive.Pipeline.Processors
|
|||
private async Task ProcessFollowersWithSharedInboxAsync(ExtractedTweet[] tweets, List<Follower> followers, SyncTwitterUser user)
|
||||
{
|
||||
var followersPerInstances = followers.GroupBy(x => x.Host);
|
||||
List<Task> todo = new List<Task>();
|
||||
|
||||
foreach (var followersPerInstance in followersPerInstances)
|
||||
{
|
||||
var t = Task.Run( async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -82,7 +85,10 @@ namespace BirdsiteLive.Pipeline.Processors
|
|||
foreach (var f in followersPerInstance)
|
||||
await ProcessFailingUserAsync(f);
|
||||
}
|
||||
});
|
||||
todo.Add(t);
|
||||
}
|
||||
await Task.WhenAll(todo);
|
||||
}
|
||||
|
||||
private async Task ProcessFollowersWithInboxAsync(ExtractedTweet[] tweets, List<Follower> followerWtInbox, SyncTwitterUser user)
|
||||
|
|
Loading…
Add table
Reference in a new issue