use settings instead of hardcoded value

This commit is contained in:
Athou
2013-07-10 11:01:24 +02:00
parent dd05bcbcde
commit 430cc9b039

View File

@@ -15,6 +15,7 @@ import com.commafeed.backend.dao.FeedEntryDAO;
import com.commafeed.backend.dao.FeedSubscriptionDAO;
import com.commafeed.backend.model.Feed;
import com.commafeed.backend.model.FeedSubscription;
import com.commafeed.backend.services.ApplicationSettingsService;
import com.google.common.collect.Lists;
public class DatabaseCleaner {
@@ -30,6 +31,9 @@ public class DatabaseCleaner {
@Inject
FeedSubscriptionDAO feedSubscriptionDAO;
@Inject
ApplicationSettingsService applicationSettingsService;
public long cleanFeedsWithoutSubscriptions() {
long total = 0;
@@ -75,7 +79,9 @@ public class DatabaseCleaner {
long total = 0;
int deleted = -1;
do {
List<FeedCount> fcs = feedDAO.findDuplicates(0, 10, 1);
List<FeedCount> fcs = feedDAO
.findDuplicates(0, applicationSettingsService.get()
.getDatabaseUpdateThreads(), 1);
deleted = fcs.size();
List<Thread> threads = Lists.newArrayList();