mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
skip entries that were deleted by the cleanup task
This commit is contained in:
@@ -5,6 +5,7 @@ import io.dropwizard.lifecycle.Managed;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
@@ -90,6 +91,11 @@ public class FeedRefreshWorker implements Managed {
|
|||||||
// stops here if NotModifiedException or any other exception is thrown
|
// stops here if NotModifiedException or any other exception is thrown
|
||||||
List<FeedEntry> entries = fetchedFeed.getEntries();
|
List<FeedEntry> entries = fetchedFeed.getEntries();
|
||||||
|
|
||||||
|
Integer maxFeedCapacity = config.getApplicationSettings().getMaxFeedCapacity();
|
||||||
|
if (maxFeedCapacity > 0) {
|
||||||
|
entries = entries.stream().limit(maxFeedCapacity).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
if (config.getApplicationSettings().getHeavyLoad()) {
|
if (config.getApplicationSettings().getHeavyLoad()) {
|
||||||
disabledUntil = FeedUtils.buildDisabledUntil(fetchedFeed.getFeed().getLastEntryDate(), fetchedFeed.getFeed()
|
disabledUntil = FeedUtils.buildDisabledUntil(fetchedFeed.getFeed().getLastEntryDate(), fetchedFeed.getFeed()
|
||||||
.getAverageEntryInterval(), disabledUntil);
|
.getAverageEntryInterval(), disabledUntil);
|
||||||
|
|||||||
Reference in New Issue
Block a user