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.Feed;
|
||||||
import com.commafeed.backend.model.FeedEntry;
|
import com.commafeed.backend.model.FeedEntry;
|
||||||
import com.commafeed.backend.model.FeedPushInfo;
|
import com.commafeed.backend.model.FeedPushInfo;
|
||||||
|
import com.commafeed.backend.services.ApplicationSettingsService;
|
||||||
import com.sun.syndication.io.FeedException;
|
import com.sun.syndication.io.FeedException;
|
||||||
|
|
||||||
public class FeedRefreshWorker {
|
public class FeedRefreshWorker {
|
||||||
@@ -37,6 +38,9 @@ public class FeedRefreshWorker {
|
|||||||
@Inject
|
@Inject
|
||||||
FeedRefreshTaskGiver taskGiver;
|
FeedRefreshTaskGiver taskGiver;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
ApplicationSettingsService applicationSettingsService;
|
||||||
|
|
||||||
public void start(MutableBoolean running, String threadName) {
|
public void start(MutableBoolean running, String threadName) {
|
||||||
log.info("{} starting", threadName);
|
log.info("{} starting", threadName);
|
||||||
while (running.isTrue()) {
|
while (running.isTrue()) {
|
||||||
@@ -83,7 +87,9 @@ public class FeedRefreshWorker {
|
|||||||
// stops here if NotModifiedException or any other exception is
|
// stops here if NotModifiedException or any other exception is
|
||||||
// thrown
|
// thrown
|
||||||
entries = fetchedFeed.getEntries();
|
entries = fetchedFeed.getEntries();
|
||||||
disabledUntil = FeedUtils.buildDisabledUntil(fetchedFeed);
|
if (applicationSettingsService.get().isHeavyLoad()) {
|
||||||
|
disabledUntil = FeedUtils.buildDisabledUntil(fetchedFeed);
|
||||||
|
}
|
||||||
|
|
||||||
feed.setLastUpdateSuccess(Calendar.getInstance().getTime());
|
feed.setLastUpdateSuccess(Calendar.getInstance().getTime());
|
||||||
feed.setLink(fetchedFeed.getFeed().getLink());
|
feed.setLink(fetchedFeed.getFeed().getLink());
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class ApplicationSettings extends AbstractModel {
|
|||||||
private boolean smtpTls;
|
private boolean smtpTls;
|
||||||
private String smtpUserName;
|
private String smtpUserName;
|
||||||
private String smtpPassword;
|
private String smtpPassword;
|
||||||
|
private boolean heavyLoad;
|
||||||
private boolean pubsubhubbub;
|
private boolean pubsubhubbub;
|
||||||
private boolean feedbackButton = true;
|
private boolean feedbackButton = true;
|
||||||
|
|
||||||
@@ -144,4 +145,12 @@ public class ApplicationSettings extends AbstractModel {
|
|||||||
this.pubsubhubbub = pubsubhubbub;
|
this.pubsubhubbub = pubsubhubbub;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isHeavyLoad() {
|
||||||
|
return heavyLoad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeavyLoad(boolean heavyLoad) {
|
||||||
|
this.heavyLoad = heavyLoad;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,6 +111,12 @@
|
|||||||
ng-model="settings.smtpPassword" />
|
ng-model="settings.smtpPassword" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label" for="heavyLoad">Heavy load</label>
|
||||||
|
<div class="controls">
|
||||||
|
<input type="checkbox" name="heavyLoad" ng-model="settings.heavyLoad" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" for="pubsubhubbub">PubSubHubbub</label>
|
<label class="control-label" for="pubsubhubbub">PubSubHubbub</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|||||||
Reference in New Issue
Block a user