-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
增强 retry()
#4021
增强 retry()
#4021
Conversation
- 增加 `$when` 参数,支持忽略异常 - 增加 `$attempts` 至回调方法 `$callback`
这个就不增加了。。写一个作为自己常用的函数吧 |
when 功能去掉吧,attempts 这个我觉得可以保留 |
好 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attempts这个,应该是从0开始比较好,还是1开始?
应该是从 1 开始,我理解的是执行次数,retry 进来就是 1 次了。 |
retry 1 实际上是会执行两次,代表重试1次 那attempts第二次,就会返回2? 我觉得是不是跟,retry的入参对应比较好,attempts 改成 retryCount ,然后从0开始记录? 这个让 @huangzhhui @Reasno 也看一下 |
不着急合并 |
OK |
当然,如果命名是attemps,那从1开始记录,还是挺合适的,我觉得都可以,让其他人也看一下吧 @huangdijia |
使用 attempts |
使用 retryCount |
投个票 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
赞成 $attempts = 0
@huangzhhui 就是现在的模式么? |
$attempts
至回调方法$callback