don't filter on having subscriptions as the query is too long to execute

This commit is contained in:
Athou
2013-07-04 10:21:00 +02:00
parent 4f09d650f6
commit 7e2ebf2dfc

View File

@@ -27,9 +27,6 @@ public class FeedDAO extends GenericDAO<Feed> {
private List<Predicate> getUpdatablePredicates(Root<Feed> root, Date threshold) {
Predicate hasSubscriptions = builder.isNotEmpty(root
.get(Feed_.subscriptions));
Predicate neverUpdated = builder.isNull(root.get(Feed_.lastUpdated));
Predicate updatedBeforeThreshold = builder.lessThan(
root.get(Feed_.lastUpdated), threshold);
@@ -39,7 +36,7 @@ public class FeedDAO extends GenericDAO<Feed> {
Predicate disabledDateIsInPast = builder.lessThan(
root.get(Feed_.disabledUntil), new Date());
return Lists.newArrayList(hasSubscriptions,
return Lists.newArrayList(
builder.or(neverUpdated, updatedBeforeThreshold),
builder.or(disabledDateIsNull, disabledDateIsInPast));
}