add FileCacheQueueScheduler support for cycleRetryTimes

pull/93/head
yihua.huang 11 years ago
parent 969ad1766b
commit c1e7207869

@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger;
* @author code4crafter@gmail.com <br> * @author code4crafter@gmail.com <br>
* @since 0.2.0 * @since 0.2.0
*/ */
public class FileCacheQueueScheduler implements Scheduler { public class FileCacheQueueScheduler extends LocalDuplicatedRemovedScheduler {
private Logger logger = LoggerFactory.getLogger(getClass()); private Logger logger = LoggerFactory.getLogger(getClass());
@ -145,16 +145,12 @@ public class FileCacheQueueScheduler implements Scheduler {
} }
@Override @Override
public synchronized void push(Request request, Task task) { protected void pushWhenNoDuplicate(Request request, Task task) {
if (!inited.get()) { if (!inited.get()) {
init(task); init(task);
} }
logger.debug("push to queue {}" , request.getUrl()); queue.add(request);
if (urls.add(request.getUrl())) { fileUrlWriter.println(request.getUrl());
queue.add(request);
fileUrlWriter.println(request.getUrl());
}
} }
@Override @Override

Loading…
Cancel
Save