forked from Archives/Athou_commafeed
removed as it in fact hurts perfs
This commit is contained in:
@@ -33,7 +33,6 @@ import com.commafeed.backend.model.FeedSubscription;
|
|||||||
import com.commafeed.backend.pubsubhubbub.SubscriptionHandler;
|
import com.commafeed.backend.pubsubhubbub.SubscriptionHandler;
|
||||||
import com.commafeed.backend.services.ApplicationSettingsService;
|
import com.commafeed.backend.services.ApplicationSettingsService;
|
||||||
import com.commafeed.backend.services.FeedUpdateService;
|
import com.commafeed.backend.services.FeedUpdateService;
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.google.common.util.concurrent.Striped;
|
import com.google.common.util.concurrent.Striped;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@@ -121,7 +120,6 @@ public class FeedRefreshUpdater {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
boolean ok = true;
|
boolean ok = true;
|
||||||
filterOldEntries();
|
|
||||||
if (entries.isEmpty() == false) {
|
if (entries.isEmpty() == false) {
|
||||||
List<FeedSubscription> subscriptions = feedSubscriptionDAO
|
List<FeedSubscription> subscriptions = feedSubscriptionDAO
|
||||||
.findByFeed(feed);
|
.findByFeed(feed);
|
||||||
@@ -139,31 +137,6 @@ public class FeedRefreshUpdater {
|
|||||||
metricsBean.feedUpdated();
|
metricsBean.feedUpdated();
|
||||||
taskGiver.giveBack(feed);
|
taskGiver.giveBack(feed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void filterOldEntries() {
|
|
||||||
|
|
||||||
if (entries != null && entries.size() > 0 && entries.size() <= 50) {
|
|
||||||
List<FeedEntry> keep = Lists.newArrayList();
|
|
||||||
|
|
||||||
List<String> guids = Lists.newArrayList();
|
|
||||||
for (FeedEntry entry : entries) {
|
|
||||||
guids.add(entry.getGuid());
|
|
||||||
}
|
|
||||||
|
|
||||||
List<FeedEntry> existingEntries = feedEntryDAO
|
|
||||||
.findByGuids(guids);
|
|
||||||
|
|
||||||
for (FeedEntry entry : entries) {
|
|
||||||
FeedEntry found = FeedUtils.findEntry(existingEntries,
|
|
||||||
entry);
|
|
||||||
if (found == null
|
|
||||||
|| FeedUtils.findFeed(found.getFeeds(), feed) == null) {
|
|
||||||
keep.add(entry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
entries = keep;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean updateEntry(final Feed feed, final FeedEntry entry,
|
private boolean updateEntry(final Feed feed, final FeedEntry entry,
|
||||||
|
|||||||
Reference in New Issue
Block a user