don't load the feed, just update it

This commit is contained in:
Athou
2015-03-19 12:35:38 +01:00
parent 3966cf165b
commit 6fd11fcd56
2 changed files with 9 additions and 1 deletions

View File

@@ -27,6 +27,14 @@ public abstract class GenericDAO<T extends AbstractModel> extends AbstractDAO<T>
models.forEach(m -> persist(m));
}
public void update(T model) {
currentSession().update(model);
}
public void update(Collection<T> models) {
models.forEach(m -> update(m));
}
public void merge(T model) {
currentSession().merge(model);
}

View File

@@ -136,7 +136,7 @@ public class FeedQueues {
// update all feeds in the database
List<Feed> feeds = map.values().stream().filter(c -> config.getApplicationSettings().getHeavyLoad() ? !c.isUrgent() : true)
.map(c -> c.getFeed()).collect(Collectors.toList());
UnitOfWork.run(sessionFactory, () -> feedDAO.merge(feeds));
UnitOfWork.run(sessionFactory, () -> feedDAO.update(feeds));
}
/**