more tweaks

This commit is contained in:
Vincent Cloutier 2022-12-26 11:48:13 -05:00
parent e21381bee8
commit 94f8d40256
4 changed files with 5 additions and 5 deletions

View file

@ -58,7 +58,7 @@ namespace BirdsiteLive.Pipeline.Processors
await _twitterUserDal.UpdateTwitterUserAsync(user.Id, user.LastTweetPostedId, user.LastTweetSynchronizedForAllFollowersId, user.FetchingErrorCount, now);
}
await Task.Delay(4 * 1000);
await Task.Delay(1 * 1000);
}
return usersWtTweets.ToArray();

View file

@ -54,7 +54,7 @@ namespace BirdsiteLive.Pipeline.Processors
await twitterUsersBufferBlock.SendAsync(u.ToArray(), ct);
}
await Task.Delay(1000, ct);
//await Task.Delay(1000, ct);
}
catch (Exception e)
{

View file

@ -47,7 +47,7 @@ namespace BirdsiteLive.Pipeline
var twitterUserToRefreshBlock = new TransformBlock<SyncTwitterUser[], UserWithDataToSync[]>(async x => await _refreshTwitterUserStatusProcessor.ProcessAsync(x, ct));
var twitterUsersBufferBlock = new BufferBlock<UserWithDataToSync[]>(new DataflowBlockOptions { BoundedCapacity = 1, CancellationToken = ct });
var retrieveTweetsBlock = new TransformBlock<UserWithDataToSync[], UserWithDataToSync[]>(async x => await _retrieveTweetsProcessor.ProcessAsync(x, ct));
var retrieveTweetsBufferBlock = new BufferBlock<UserWithDataToSync[]>(new DataflowBlockOptions { BoundedCapacity = 1, CancellationToken = ct });
var retrieveTweetsBufferBlock = new BufferBlock<UserWithDataToSync[]>(new DataflowBlockOptions { BoundedCapacity = 5, CancellationToken = ct });
var retrieveFollowersBlock = new TransformManyBlock<UserWithDataToSync[], UserWithDataToSync>(async x => await _retrieveFollowersProcessor.ProcessAsync(x, ct));
var retrieveFollowersBufferBlock = new BufferBlock<UserWithDataToSync>(new DataflowBlockOptions { BoundedCapacity = 20, CancellationToken = ct });
var sendTweetsToFollowersBlock = new TransformBlock<UserWithDataToSync, UserWithDataToSync>(async x => await _sendTweetsToFollowersProcessor.ProcessAsync(x, ct), new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = 5, CancellationToken = ct });

View file

@ -135,7 +135,7 @@ namespace BirdsiteLive.Controllers
[Route("/@{id}/{statusId}")]
[Route("/users/{id}/statuses/{statusId}")]
public IActionResult Tweet(string id, string statusId)
public async Task<IActionResult> Tweet(string id, string statusId)
{
var acceptHeaders = Request.Headers["Accept"];
if (acceptHeaders.Any())
@ -146,7 +146,7 @@ namespace BirdsiteLive.Controllers
if (!long.TryParse(statusId, out var parsedStatusId))
return NotFound();
var tweet = _twitterTweetService.GetTweet(parsedStatusId);
var tweet = await _twitterTweetService.GetTweetAsync(parsedStatusId);
if (tweet == null)
return NotFound();