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