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

Why retry method with predicate only retries 2 times? #2826

Closed
fatroom opened this issue Mar 15, 2015 · 1 comment
Closed

Why retry method with predicate only retries 2 times? #2826

fatroom opened this issue Mar 15, 2015 · 1 comment
Labels

Comments

@fatroom
Copy link

fatroom commented Mar 15, 2015

Hi, can somebody explain me why following piece of code printing only two times message "Retrying"? And not 5 times as specified in predicate?
BTW if i uncomment doOnError line in this sample - i got 5 times message "Retrying".
Any ideas what's going on here?

Observable.just(1)
                .map(value -> { throw new RuntimeException("You shall not pass"); })
//                .doOnError(t -> System.out.println("Handling error"))
                .retry((counter, throwable) -> {
                    System.out.println("Retrying");
                    return counter < 5;
                })
                .toBlocking()
                .single();
@akarnokd
Copy link
Member

The bug has been fixed through #2852. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants