fixed tests

This commit is contained in:
Vincent Cloutier 2022-12-26 14:14:25 -05:00
parent 94f8d40256
commit 999e0c2ba2
2 changed files with 7 additions and 6 deletions

View file

@ -44,8 +44,9 @@ namespace BirdsiteLive.Pipeline.Processors
var maxUsersNumber = await _maxUsersNumberProvider.GetMaxUsersNumberAsync();
var users = await _twitterUserDal.GetAllTwitterUsersAsync(maxUsersNumber);
var splitNumber = users.Any() ? users.Length : 25;
var splitUsers = users.Split(splitNumber).ToList();
var userCount = users.Any() ? Math.Min(users.Length, 25) : 1;
//var splitNumber = (int) Math.Ceiling(userCount / 15d);
var splitUsers = users.Split(userCount).ToList();
foreach (var u in splitUsers)
{
@ -54,7 +55,7 @@ namespace BirdsiteLive.Pipeline.Processors
await twitterUsersBufferBlock.SendAsync(u.ToArray(), ct);
}
//await Task.Delay(1000, ct);
await Task.Delay(1000, ct);
}
catch (Exception e)
{
@ -63,4 +64,4 @@ namespace BirdsiteLive.Pipeline.Processors
}
}
}
}
}

View file

@ -57,7 +57,7 @@ namespace BirdsiteLive.Pipeline.Tests.Processors
twitterUserDalMock.VerifyAll();
Assert.IsTrue(0 < buffer.Count);
buffer.TryReceive(out var result);
Assert.IsTrue(1 < result.Length);
Assert.IsTrue(0 < result.Length);
#endregion
}
@ -268,4 +268,4 @@ namespace BirdsiteLive.Pipeline.Tests.Processors
throw e;
}
}
}
}