redouane59 / twittered

Twitter API client for Java developers
Apache License 2.0
239 stars 66 forks source link

fix for issue #440 and improved rate limit handling #442

Closed swisstechguy closed 1 year ago

swisstechguy commented 1 year ago

fixed the issue with negative sleep times and improves rate limit by reading x-rate-limit-remaining header. added sleep for calls to /2/tweets/search/all within less than 1s to be compliant with the rate limit of this API (max 1 request per second)

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 4 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

redouane59 commented 1 year ago

Hi @swisstechuy, thank you very much ! Did you test it ? Everything is working well, included other endpoints ?

Thanks !

swisstechguy commented 1 year ago

Hi @redouane59 , yes I tested quite a few endpoints. All worked well. But I don't have a test for calling ALL endpoints. The way I enhanced the rate limit should work for all endpoints.