fix a spider init problem

master
yihua.huang 2013-07-29 10:59:23 +08:00
parent 54904851ea
commit 18fefa0c0a
1 changed files with 3 additions and 1 deletions

View File

@ -270,7 +270,9 @@ public class Spider implements Runnable, Task {
if (threadNum <= 0) {
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) {
return this;
}