mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
use settings instead of hardcoded value
This commit is contained in:
@@ -15,6 +15,7 @@ import com.commafeed.backend.dao.FeedEntryDAO;
|
|||||||
import com.commafeed.backend.dao.FeedSubscriptionDAO;
|
import com.commafeed.backend.dao.FeedSubscriptionDAO;
|
||||||
import com.commafeed.backend.model.Feed;
|
import com.commafeed.backend.model.Feed;
|
||||||
import com.commafeed.backend.model.FeedSubscription;
|
import com.commafeed.backend.model.FeedSubscription;
|
||||||
|
import com.commafeed.backend.services.ApplicationSettingsService;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
public class DatabaseCleaner {
|
public class DatabaseCleaner {
|
||||||
@@ -30,6 +31,9 @@ public class DatabaseCleaner {
|
|||||||
@Inject
|
@Inject
|
||||||
FeedSubscriptionDAO feedSubscriptionDAO;
|
FeedSubscriptionDAO feedSubscriptionDAO;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
ApplicationSettingsService applicationSettingsService;
|
||||||
|
|
||||||
public long cleanFeedsWithoutSubscriptions() {
|
public long cleanFeedsWithoutSubscriptions() {
|
||||||
|
|
||||||
long total = 0;
|
long total = 0;
|
||||||
@@ -75,7 +79,9 @@ public class DatabaseCleaner {
|
|||||||
long total = 0;
|
long total = 0;
|
||||||
int deleted = -1;
|
int deleted = -1;
|
||||||
do {
|
do {
|
||||||
List<FeedCount> fcs = feedDAO.findDuplicates(0, 10, 1);
|
List<FeedCount> fcs = feedDAO
|
||||||
|
.findDuplicates(0, applicationSettingsService.get()
|
||||||
|
.getDatabaseUpdateThreads(), 1);
|
||||||
deleted = fcs.size();
|
deleted = fcs.size();
|
||||||
|
|
||||||
List<Thread> threads = Lists.newArrayList();
|
List<Thread> threads = Lists.newArrayList();
|
||||||
|
|||||||
Reference in New Issue
Block a user