Return spider in setEmptySleepTime itself for chainning.
parent
ac912e8f1f
commit
075b98291b
|
@ -333,9 +333,10 @@ public class Spider implements Runnable, Task {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// wait until new url added,
|
// wait until new url added,
|
||||||
if (waitNewUrl())
|
if (waitNewUrl()) {
|
||||||
//if interrupted
|
//if interrupted
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -805,11 +806,13 @@ public class Spider implements Runnable, Task {
|
||||||
* Set wait time when no url is polled.<br><br>
|
* Set wait time when no url is polled.<br><br>
|
||||||
*
|
*
|
||||||
* @param emptySleepTime In MILLISECONDS.
|
* @param emptySleepTime In MILLISECONDS.
|
||||||
|
* @return this
|
||||||
*/
|
*/
|
||||||
public void setEmptySleepTime(long emptySleepTime) {
|
public Spider setEmptySleepTime(long emptySleepTime) {
|
||||||
if(emptySleepTime<=0){
|
if(emptySleepTime<=0){
|
||||||
throw new IllegalArgumentException("emptySleepTime should be more than zero!");
|
throw new IllegalArgumentException("emptySleepTime should be more than zero!");
|
||||||
}
|
}
|
||||||
this.emptySleepTime = emptySleepTime;
|
this.emptySleepTime = emptySleepTime;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue