From e735e4e585f965ba3dabbd2faae3ad6665a4681b Mon Sep 17 00:00:00 2001 From: Joe Zhou Date: Sun, 20 Nov 2022 18:31:36 +0800 Subject: [PATCH] Log the remaining capacity. --- .../us/codecraft/webmagic/scheduler/QueueScheduler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/scheduler/QueueScheduler.java b/webmagic-core/src/main/java/us/codecraft/webmagic/scheduler/QueueScheduler.java index 8ea3ab19..04d5b36b 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/scheduler/QueueScheduler.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/scheduler/QueueScheduler.java @@ -1,11 +1,10 @@ package us.codecraft.webmagic.scheduler; -import us.codecraft.webmagic.Request; -import us.codecraft.webmagic.Task; - import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; +import us.codecraft.webmagic.Request; +import us.codecraft.webmagic.Task; /** * Basic Scheduler implementation.
@@ -35,6 +34,8 @@ public class QueueScheduler extends DuplicateRemovedScheduler implements Monitor @Override public void pushWhenNoDuplicate(Request request, Task task) { + logger.trace("Remaining capacity: {}", this.queue.remainingCapacity()); + try { queue.put(request); } catch (InterruptedException e) {