mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
javadoc tweaks
This commit is contained in:
@@ -138,8 +138,10 @@ public interface CommaFeedConfiguration {
|
|||||||
Duration interval();
|
Duration interval();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If true, CommaFeed will calculate the next refresh time based on the feed's average entry interval and the time since the last
|
* If true, CommaFeed will calculate the next refresh time based on the feed's average time between entries and the time since the
|
||||||
* entry was published. See {@link FeedRefreshIntervalCalculator} for details.
|
* last entry was published. The interval will be somewhere between the default refresh interval and 24h.
|
||||||
|
*
|
||||||
|
* See {@link FeedRefreshIntervalCalculator} for details.
|
||||||
*/
|
*/
|
||||||
@WithDefault("false")
|
@WithDefault("false")
|
||||||
boolean intervalEmpirical();
|
boolean intervalEmpirical();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class FeedRefreshIntervalCalculator {
|
|||||||
|
|
||||||
public Instant onFetchSuccess(Instant publishedDate, Long averageEntryInterval) {
|
public Instant onFetchSuccess(Instant publishedDate, Long averageEntryInterval) {
|
||||||
Instant defaultRefreshInterval = getDefaultRefreshInterval();
|
Instant defaultRefreshInterval = getDefaultRefreshInterval();
|
||||||
return empiricalInterval ? computeRefreshIntervalForHeavyLoad(publishedDate, averageEntryInterval, defaultRefreshInterval)
|
return empiricalInterval ? computeEmpiricalRefreshInterval(publishedDate, averageEntryInterval, defaultRefreshInterval)
|
||||||
: defaultRefreshInterval;
|
: defaultRefreshInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ public class FeedRefreshIntervalCalculator {
|
|||||||
return Instant.now().plus(refreshInterval);
|
return Instant.now().plus(refreshInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Instant computeRefreshIntervalForHeavyLoad(Instant publishedDate, Long averageEntryInterval, Instant defaultRefreshInterval) {
|
private Instant computeEmpiricalRefreshInterval(Instant publishedDate, Long averageEntryInterval, Instant defaultRefreshInterval) {
|
||||||
Instant now = Instant.now();
|
Instant now = Instant.now();
|
||||||
|
|
||||||
if (publishedDate == null) {
|
if (publishedDate == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user