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

希望作者可以将doCycleRetry改成protect访问级别 #1145

Open
hackeryutu opened this issue Jan 19, 2024 · 2 comments
Open

希望作者可以将doCycleRetry改成protect访问级别 #1145

hackeryutu opened this issue Jan 19, 2024 · 2 comments

Comments

@hackeryutu
Copy link

希望作者可以将doCycleRetry改成protect访问级别,外部可以重写这个方法改变行为。

比如重试三次之后还是失败就没然后了, 我想通过改写这个方法做一些通知

@sutra
Copy link
Collaborator

sutra commented Jan 19, 2024

us.codecraft.webmagic.SpiderListener.onError(Request, Exception) 读取request.getExtra(Request.CYCLE_TRIED_TIMES),如果次数等于 site.getCycleRetryTimes()就发通知。

@hackeryutu
Copy link
Author

我看的是0.10.0的代码,只有在page.isDownloadSuccess()是false的情况下才会走重试逻辑,不会走到onError中而是走到onSuccess中。 我感觉哪里怪怪的,isDownloadSuccess如果是false 不应该走onError方法吗?

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