mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
settings for heavy load
This commit is contained in:
@@ -21,6 +21,7 @@ import com.commafeed.backend.HttpGetter.NotModifiedException;
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.backend.model.FeedEntry;
|
||||
import com.commafeed.backend.model.FeedPushInfo;
|
||||
import com.commafeed.backend.services.ApplicationSettingsService;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
|
||||
public class FeedRefreshWorker {
|
||||
@@ -37,6 +38,9 @@ public class FeedRefreshWorker {
|
||||
@Inject
|
||||
FeedRefreshTaskGiver taskGiver;
|
||||
|
||||
@Inject
|
||||
ApplicationSettingsService applicationSettingsService;
|
||||
|
||||
public void start(MutableBoolean running, String threadName) {
|
||||
log.info("{} starting", threadName);
|
||||
while (running.isTrue()) {
|
||||
@@ -83,7 +87,9 @@ public class FeedRefreshWorker {
|
||||
// stops here if NotModifiedException or any other exception is
|
||||
// thrown
|
||||
entries = fetchedFeed.getEntries();
|
||||
disabledUntil = FeedUtils.buildDisabledUntil(fetchedFeed);
|
||||
if (applicationSettingsService.get().isHeavyLoad()) {
|
||||
disabledUntil = FeedUtils.buildDisabledUntil(fetchedFeed);
|
||||
}
|
||||
|
||||
feed.setLastUpdateSuccess(Calendar.getInstance().getTime());
|
||||
feed.setLink(fetchedFeed.getFeed().getLink());
|
||||
|
||||
@@ -25,6 +25,7 @@ public class ApplicationSettings extends AbstractModel {
|
||||
private boolean smtpTls;
|
||||
private String smtpUserName;
|
||||
private String smtpPassword;
|
||||
private boolean heavyLoad;
|
||||
private boolean pubsubhubbub;
|
||||
private boolean feedbackButton = true;
|
||||
|
||||
@@ -144,4 +145,12 @@ public class ApplicationSettings extends AbstractModel {
|
||||
this.pubsubhubbub = pubsubhubbub;
|
||||
}
|
||||
|
||||
public boolean isHeavyLoad() {
|
||||
return heavyLoad;
|
||||
}
|
||||
|
||||
public void setHeavyLoad(boolean heavyLoad) {
|
||||
this.heavyLoad = heavyLoad;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user