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

开启一个5s倒计时,在收到finish回调里再次调用start,后续的倒计时开始时间会比初始时候少1,也就是从4s开始 #9

Open
mai2579017147 opened this issue Dec 6, 2024 · 2 comments

Comments

@mai2579017147
Copy link

复现代码:
Interval(1, 1, TimeUnit.SECONDS, 5) .subscribe { Log.e("TAG", "subscribe=$it") } .finish { start() } .start()
原因:源码里finish回调出来后,还对count进行操作,导致finish中start重置的count值多进行了一次操作
a
推荐解决方案:对count的操作放在finish回调不成立的时候,多添加一个else
b
可能有考虑不到的情况,大佬多指教

@liangjingkanji
Copy link
Owner

看起来的确是这个问题
不知道你是否想发起pr修复该问题

@mai2579017147
Copy link
Author

可以的,晚点我试试

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