Browse Source

Merge pull request #116 from NicolasConstant/topic_support-day-rate-limit

Topic support day rate limit
master
Nicolas Constant 12 months ago
committed by GitHub
parent
commit
5b34819270
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions
  1. +6
    -1
      src/BirdsiteLive.Pipeline/Processors/RetrieveTwitterUsersProcessor.cs
  2. +1
    -1
      src/BirdsiteLive/BirdsiteLive.csproj

+ 6
- 1
src/BirdsiteLive.Pipeline/Processors/RetrieveTwitterUsersProcessor.cs View File

@ -55,7 +55,12 @@ namespace BirdsiteLive.Pipeline.Processors
}
var splitCount = splitUsers.Count();
if (splitCount < 15) await Task.Delay((15 - splitCount) * WaitFactor, ct);
if (splitCount < 15) await Task.Delay((15 - splitCount) * WaitFactor, ct); //Always wait 15min
// Extra wait time to fit 100.000/day limit
var extraWaitTime = (int)Math.Ceiling((60 / ((100000d / 24) / userCount)) - 15);
if (extraWaitTime < 0) extraWaitTime = 0;
await Task.Delay(extraWaitTime * 1000, ct);
}
catch (Exception e)
{


+ 1
- 1
src/BirdsiteLive/BirdsiteLive.csproj View File

@ -4,7 +4,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<UserSecretsId>d21486de-a812-47eb-a419-05682bb68856</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<Version>0.18.0</Version>
<Version>0.18.1</Version>
</PropertyGroup>
<ItemGroup>


Loading…
Cancel
Save