RetrieveTwitterUsersProcessor tweaks
This commit is contained in:
parent
3346b7b5e8
commit
46f7594e43
1 changed files with 21 additions and 21 deletions
|
@ -38,8 +38,12 @@ namespace BirdsiteLive.Pipeline.Processors
|
||||||
{
|
{
|
||||||
ct.ThrowIfCancellationRequested();
|
ct.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
try
|
if (_instanceSettings.ParallelTwitterRequests == 0)
|
||||||
{
|
{
|
||||||
|
while (true)
|
||||||
|
await Task.Delay(10000);
|
||||||
|
}
|
||||||
|
|
||||||
var users = await _twitterUserDal.GetAllTwitterUsersWithFollowersAsync(2000, _instanceSettings.n_start, _instanceSettings.n_end, _instanceSettings.m);
|
var users = await _twitterUserDal.GetAllTwitterUsersWithFollowersAsync(2000, _instanceSettings.n_start, _instanceSettings.n_end, _instanceSettings.m);
|
||||||
|
|
||||||
var userCount = users.Any() ? Math.Min(users.Length, 200) : 1;
|
var userCount = users.Any() ? Math.Min(users.Length, 200) : 1;
|
||||||
|
@ -55,15 +59,11 @@ namespace BirdsiteLive.Pipeline.Processors
|
||||||
);
|
);
|
||||||
|
|
||||||
await twitterUsersBufferBlock.SendAsync(toSync, ct);
|
await twitterUsersBufferBlock.SendAsync(toSync, ct);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.Delay(10, ct); // this is somehow necessary
|
await Task.Delay(10, ct); // this is somehow necessary
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
_logger.LogError(e, "Failing retrieving Twitter Users.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue