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>
* @since 0.2.0
*/
public class FileCacheQueueScheduler implements Scheduler {
public class FileCacheQueueScheduler extends LocalDuplicatedRemovedScheduler {
private Logger logger = LoggerFactory.getLogger(getClass());
@ -145,16 +145,12 @@ public class FileCacheQueueScheduler implements Scheduler {
}
@Override
public synchronized void push(Request request, Task task) {
protected void pushWhenNoDuplicate(Request request, Task task) {
if (!inited.get()) {
init(task);
}
logger.debug("push to queue {}" , request.getUrl());
if (urls.add(request.getUrl())) {
queue.add(request);
fileUrlWriter.println(request.getUrl());
}
queue.add(request);
fileUrlWriter.println(request.getUrl());
}
@Override

Loading…
Cancel
Save