mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
cache the "tree"
This commit is contained in:
@@ -106,7 +106,7 @@ public class FeedRefreshUpdater {
|
||||
|
||||
List<FeedSubscription> subscriptions = null;
|
||||
for (FeedEntry entry : entries) {
|
||||
String cacheKey = cache.buildKey(feed, entry);
|
||||
String cacheKey = cache.buildUniqueEntryKey(feed, entry);
|
||||
if (!lastEntries.contains(cacheKey)) {
|
||||
log.debug("cache miss for {}", entry.getUrl());
|
||||
if (subscriptions == null) {
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.commafeed.backend.cache.CacheService;
|
||||
import com.commafeed.backend.dao.FeedCategoryDAO;
|
||||
import com.commafeed.backend.model.FeedCategory;
|
||||
import com.commafeed.backend.model.User;
|
||||
@@ -34,6 +35,9 @@ public class OPMLImporter {
|
||||
@Inject
|
||||
FeedCategoryDAO feedCategoryDAO;
|
||||
|
||||
@Inject
|
||||
CacheService cache;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Asynchronous
|
||||
public void importOpml(User user, String xml) {
|
||||
@@ -77,16 +81,17 @@ public class OPMLImporter {
|
||||
if (StringUtils.isBlank(title)) {
|
||||
title = "Unnamed subscription";
|
||||
}
|
||||
|
||||
// make sure we continue with the import process even a feed failed
|
||||
try {
|
||||
feedSubscriptionService.subscribe(user, outline.getXmlUrl(), title,
|
||||
parent);
|
||||
|
||||
} catch (FeedSubscriptionException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
log.error("error while importing {}: {}", outline.getXmlUrl(), e.getMessage());
|
||||
}
|
||||
}
|
||||
cache.invalidateRootCategory(user);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user