Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException: timeout value is negative #440

Open
swisstechguy opened this issue Mar 31, 2023 · 4 comments
Open

IllegalArgumentException: timeout value is negative #440

swisstechguy opened this issue Mar 31, 2023 · 4 comments

Comments

@swisstechguy
Copy link
Contributor

The following error occurs in long during searchAll queries:

07:19:55.057 [main ] INFO i.g.r.t.h.AbstractRequestHelper Rate limit exceeded, new retry in at 07:19
07:19:55.058 [main ] ERROR c.z.n.b.twitter.TweetsCatcher ERROR catched in main, wait 60s and restart
java.lang.IllegalArgumentException: timeout value is negative
at java.base/java.lang.Thread.sleep(Native Method)
at io.github.redouane59.twitter.helpers.AbstractRequestHelper.makeRequest(AbstractRequestHelper.java:104)
at io.github.redouane59.twitter.helpers.AbstractRequestHelper.makeRequest(AbstractRequestHelper.java:76)
at io.github.redouane59.twitter.helpers.AbstractRequestHelper.makeRequest(AbstractRequestHelper.java:54)
at io.github.redouane59.twitter.helpers.RequestHelperV2.getRequestWithParameters(RequestHelperV2.java:50)
at io.github.redouane59.twitter.TwitterClient.getTweetsRecursively(TwitterClient.java:910)
at io.github.redouane59.twitter.TwitterClient.searchAllTweets(TwitterClient.java:899)

The problem is since version 2.20 since the AbstractRequestHelper reads 'x-rate-limit-reset' in line 92.

solution: check retryAfter for negative values and don't sleep if retryAfter is negative.

Thanks for this great project!

@redouane59
Copy link
Owner

Hello, thanks for the issue.

Do you think you could submit a PR ? Then I'll be able to release a new version as talked here :
#438

@swisstechguy
Copy link
Contributor Author

yes, I can do that. where can I commit?

@redouane59
Copy link
Owner

Just fork the project, do your job, and then submit a Pull Request to this repository :)

swisstechguy added a commit to swisstechguy/twittered that referenced this issue Apr 1, 2023
@swisstechguy
Copy link
Contributor Author

done, thanks.

redouane59 added a commit that referenced this issue Apr 3, 2023
* Added @Jacksonized to all @builder classes. (#428)

* Updated README.md (#431)

Updated README.md with the correct print statements for the user example.

* Empty predicate (#434)

* Fix formatting

* Handle empty predicates

This commit improves FilteredStreamRulePredicate so that an empty
predicate is handled properly when associated with an operator.

* Bump jackson-databind from 2.13.4.1 to 2.13.4.2 (#441)

Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.13.4.1 to 2.13.4.2.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix for issue #440 and improved rate limit handling (#442)

* update version

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: takeshitakenji <[email protected]>
Co-authored-by: suomi35 <[email protected]>
Co-authored-by: Stéphane Nicoll <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Swiss Dev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants