Commit e8abc280 authored by yihua.huang's avatar yihua.huang

#552 add some log when crawler stop

parent cbf80af5
...@@ -303,7 +303,7 @@ public class Spider implements Runnable, Task { ...@@ -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 { ...@@ -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) {
......
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