Commit 18fefa0c authored by yihua.huang's avatar yihua.huang

fix a spider init problem

parent 54904851
...@@ -270,7 +270,9 @@ public class Spider implements Runnable, Task { ...@@ -270,7 +270,9 @@ public class Spider implements Runnable, Task {
if (threadNum <= 0) { if (threadNum <= 0) {
throw new IllegalArgumentException("threadNum should be more than one!"); throw new IllegalArgumentException("threadNum should be more than one!");
} }
downloader = new HttpClientDownloader(threadNum); if (downloader==null || downloader instanceof HttpClientDownloader){
downloader = new HttpClientDownloader(threadNum);
}
if (threadNum == 1) { if (threadNum == 1) {
return this; return this;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment