Log the remaining capacity.

pull/1015/merge
Joe Zhou 2 years ago
parent 4915431845
commit e735e4e585

@ -1,11 +1,10 @@
package us.codecraft.webmagic.scheduler; package us.codecraft.webmagic.scheduler;
import us.codecraft.webmagic.Request;
import us.codecraft.webmagic.Task;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import us.codecraft.webmagic.Request;
import us.codecraft.webmagic.Task;
/** /**
* Basic Scheduler implementation.<br> * Basic Scheduler implementation.<br>
@ -35,6 +34,8 @@ public class QueueScheduler extends DuplicateRemovedScheduler implements Monitor
@Override @Override
public void pushWhenNoDuplicate(Request request, Task task) { public void pushWhenNoDuplicate(Request request, Task task) {
logger.trace("Remaining capacity: {}", this.queue.remainingCapacity());
try { try {
queue.put(request); queue.put(request);
} catch (InterruptedException e) { } catch (InterruptedException e) {

Loading…
Cancel
Save