javadoc tweaks

This commit is contained in:
Athou
2024-08-17 22:11:47 +02:00
parent e38ca66c51
commit 9218f19832
2 changed files with 6 additions and 4 deletions

View File

@@ -138,8 +138,10 @@ public interface CommaFeedConfiguration {
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
* entry was published. See {@link FeedRefreshIntervalCalculator} for details.
* If true, CommaFeed will calculate the next refresh time based on the feed's average time between entries and the time since the
* last entry was published. The interval will be somewhere between the default refresh interval and 24h.
*
* See {@link FeedRefreshIntervalCalculator} for details.
*/
@WithDefault("false")
boolean intervalEmpirical();

View File

@@ -21,7 +21,7 @@ public class FeedRefreshIntervalCalculator {
public Instant onFetchSuccess(Instant publishedDate, Long averageEntryInterval) {
Instant defaultRefreshInterval = getDefaultRefreshInterval();
return empiricalInterval ? computeRefreshIntervalForHeavyLoad(publishedDate, averageEntryInterval, defaultRefreshInterval)
return empiricalInterval ? computeEmpiricalRefreshInterval(publishedDate, averageEntryInterval, defaultRefreshInterval)
: defaultRefreshInterval;
}
@@ -43,7 +43,7 @@ public class FeedRefreshIntervalCalculator {
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();
if (publishedDate == null) {