return when page is null
parent
0336f4cdb4
commit
179baa7a22
|
@ -402,6 +402,7 @@ public class Spider implements Runnable, Task {
|
|||
if (page == null) {
|
||||
sleep(site.getSleepTime());
|
||||
onError(request);
|
||||
return;
|
||||
}
|
||||
// for cycle retry
|
||||
if (page.isNeedCycleRetry()) {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class PatternProcessorExample {
|
|||
}
|
||||
};
|
||||
|
||||
CompositePageProcessor pageProcessor = new CompositePageProcessor(Site.me().setDomain("github.com").setRetryTimes(0).setSleepTime(0));
|
||||
CompositePageProcessor pageProcessor = new CompositePageProcessor(Site.me().setDomain("github.com").setRetryTimes(3));
|
||||
CompositePipeline pipeline = new CompositePipeline();
|
||||
|
||||
pageProcessor.setSubPageProcessors(githubRepoProcessor, githubUserProcessor);
|
||||
|
|
Loading…
Reference in New Issue