#552 add some log when crawler stop
parent
cbf80af5dd
commit
e8abc28072
|
@ -303,7 +303,7 @@ public class Spider implements Runnable, Task {
|
||||||
public void run() {
|
public void run() {
|
||||||
checkRunningStat();
|
checkRunningStat();
|
||||||
initComponent();
|
initComponent();
|
||||||
logger.info("Spider " + getUUID() + " started!");
|
logger.info("Spider {} started!",getUUID());
|
||||||
while (!Thread.currentThread().isInterrupted() && stat.get() == STAT_RUNNING) {
|
while (!Thread.currentThread().isInterrupted() && stat.get() == STAT_RUNNING) {
|
||||||
final Request request = scheduler.poll(this);
|
final Request request = scheduler.poll(this);
|
||||||
if (request == null) {
|
if (request == null) {
|
||||||
|
@ -335,6 +335,7 @@ public class Spider implements Runnable, Task {
|
||||||
if (destroyWhenExit) {
|
if (destroyWhenExit) {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
logger.info("Spider {} closed! {} pages downloaded.", getUUID(), pageCount.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onError(Request request) {
|
protected void onError(Request request) {
|
||||||
|
|
Loading…
Reference in New Issue