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 {
public void run() {
checkRunningStat();
initComponent();
logger.info("Spider " + getUUID() + " started!");
logger.info("Spider {} started!",getUUID());
while (!Thread.currentThread().isInterrupted() && stat.get() == STAT_RUNNING) {
final Request request = scheduler.poll(this);
if (request == null) {
......@@ -335,6 +335,7 @@ public class Spider implements Runnable, Task {
if (destroyWhenExit) {
close();
}
logger.info("Spider {} closed! {} pages downloaded.", getUUID(), pageCount.get());
}
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