mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
don't load the feed, just update it
This commit is contained in:
@@ -27,6 +27,14 @@ public abstract class GenericDAO<T extends AbstractModel> extends AbstractDAO<T>
|
|||||||
models.forEach(m -> persist(m));
|
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) {
|
public void merge(T model) {
|
||||||
currentSession().merge(model);
|
currentSession().merge(model);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ public class FeedQueues {
|
|||||||
// update all feeds in the database
|
// update all feeds in the database
|
||||||
List<Feed> feeds = map.values().stream().filter(c -> config.getApplicationSettings().getHeavyLoad() ? !c.isUrgent() : true)
|
List<Feed> feeds = map.values().stream().filter(c -> config.getApplicationSettings().getHeavyLoad() ? !c.isUrgent() : true)
|
||||||
.map(c -> c.getFeed()).collect(Collectors.toList());
|
.map(c -> c.getFeed()).collect(Collectors.toList());
|
||||||
UnitOfWork.run(sessionFactory, () -> feedDAO.merge(feeds));
|
UnitOfWork.run(sessionFactory, () -> feedDAO.update(feeds));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user