diff --git a/CHANGELOG.md b/CHANGELOG.md index 38f6d3e76..15c0e715e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ You can also check [on GitHub](https://github.com/nextcloud/news/releases), the ## [25.x.x] ### Changed - Set mobileLayout to `horizontal-split` and add nav buttons for articles in mobile view +- set the duration after which a feed is considered sleepy to 7 days when using `nextUpdateTime` +- limit the time to the next update to a maximum of 24 hours when using `nextUpdateTime` + ### Fixed - Show error on folders only if at least one feed has more than eight errors diff --git a/docs/admin.md b/docs/admin.md index 6d8691d31..909e4a5b5 100644 --- a/docs/admin.md +++ b/docs/admin.md @@ -65,6 +65,6 @@ The new value is only applied after the next run of the updater. Starting with News 25.2.0, the app can dynamically adjust update schedules based on feed activity. This feature, disabled by default, can be enabled by the Nextcloud administrator. -By analyzing feed data, the app can optimize update frequencies, potentially reducing server load and network traffic. However, this feature may not work correctly with all feeds. +By analyzing feed data, the app can optimize update frequencies, potentially reducing server load and network traffic. The time until the next calculated update point is limited to a maximum of 24 hours. However, this feature may not work correctly with all feeds. Users can check the calculated next update time in the app's settings. This information will only be displayed when the dynamic update scheduling feature is enabled. diff --git a/lib/Config/FetcherConfig.php b/lib/Config/FetcherConfig.php index 3bc09324a..bab488b6b 100644 --- a/lib/Config/FetcherConfig.php +++ b/lib/Config/FetcherConfig.php @@ -72,7 +72,7 @@ class FetcherConfig * Duration after which the feed is considered sleepy. * @var int */ - public const SLEEPY_DURATION = 86400; + public const SLEEPY_DURATION = 7 * 86400; /** * Logger diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php index 9755246d3..3504e84f7 100755 --- a/lib/Fetcher/FeedFetcher.php +++ b/lib/Fetcher/FeedFetcher.php @@ -149,9 +149,10 @@ public function fetch( $location ); - $feed->setNextUpdateTime(nextUpdateTime: $resource->getNextUpdate( + // Set the next calculated update time, but maximum 24 hours from now + $feed->setNextUpdateTime(nextUpdateTime: min($resource->getNextUpdate( sleepyDuration: $this->fetcherConfig::SLEEPY_DURATION - )?->getTimestamp()); + )?->getTimestamp(), time() + 86400)); $this->logger->debug( 'Feed {url} was parsed and nextUpdateTime is {nextUpdateTime}',