forked from Archives/Athou_commafeed
avoid an extra database roundtrip
This commit is contained in:
@@ -106,8 +106,7 @@ public class FeedRefreshWorker {
|
|||||||
transaction.begin();
|
transaction.begin();
|
||||||
|
|
||||||
if (fetchedFeed != null) {
|
if (fetchedFeed != null) {
|
||||||
feedUpdateService.updateEntries(feed.getUrl(),
|
feedUpdateService.updateEntries(feed, fetchedFeed.getEntries());
|
||||||
fetchedFeed.getEntries());
|
|
||||||
if (feed.getLink() == null) {
|
if (feed.getLink() == null) {
|
||||||
feed.setLink(fetchedFeed.getLink());
|
feed.setLink(fetchedFeed.getLink());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,7 @@ public class FeedUpdateService {
|
|||||||
@Inject
|
@Inject
|
||||||
FeedEntryStatusDAO feedEntryStatusDAO;
|
FeedEntryStatusDAO feedEntryStatusDAO;
|
||||||
|
|
||||||
public void updateEntries(String url, Collection<FeedEntry> entries) {
|
public void updateEntries(Feed feed, Collection<FeedEntry> entries) {
|
||||||
Feed feed = feedDAO.findByUrl(url);
|
|
||||||
List<String> guids = Lists.newArrayList();
|
List<String> guids = Lists.newArrayList();
|
||||||
for (FeedEntry entry : entries) {
|
for (FeedEntry entry : entries) {
|
||||||
guids.add(entry.getGuid());
|
guids.add(entry.getGuid());
|
||||||
|
|||||||
Reference in New Issue
Block a user