summaryrefslogtreecommitdiffstats
path: root/lib/Fetcher
diff options
context:
space:
mode:
authorKevin Decherf <kevin@kdecherf.com>2020-12-09 22:13:09 +0100
committerBenjamin Brahmer <info@b-brahmer.de>2020-12-15 20:02:21 +0100
commit42ea24f2f41ce04588aa929e5ffdaf1dbeb1a700 (patch)
tree657089d619d1ee76d8f86dbf8553f9ce86c6867d /lib/Fetcher
parent1345cedd7e226c23a9fff6275a0fb71e444aa1b3 (diff)
Remove LastModified-based cursor when updating feeds
We remove the call to readSince() as some feeds push new articles with pubDate prior to the lastModified time stored for these feeds (e.g. lemonde.fr). As we go through all items of a feed again and again, we prevent the constant update of an item's lastModified timestamp by keeping the previous one if its fingerprint does not change. Fixes #921 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'lib/Fetcher')
-rwxr-xr-xlib/Fetcher/FeedFetcher.php16
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php
index fa6d9a346..b9526165d 100755
--- a/lib/Fetcher/FeedFetcher.php
+++ b/lib/Fetcher/FeedFetcher.php
@@ -111,21 +111,7 @@ class FeedFetcher implements IFeedFetcher
}
$url = $url2->getNormalizedURL();
$this->reader->resetFilters();
- if (empty($lastModified) || !is_string($lastModified)) {
- $resource = $this->reader->read($url);
- } else {
- $resource = $this->reader->readSince($url, new DateTime($lastModified));
- }
-
- $response = $resource->getResponse();
- if (!$response->isModified()) {
- $this->logger->debug('Feed {url} was not modified since last fetch. old: {old}, new: {new}', [
- 'url' => $url,
- 'old' => print_r($lastModified, true),
- 'new' => print_r($response->getLastModified(), true),
- ]);
- return [null, []];
- }
+ $resource = $this->reader->read($url);
$location = $resource->getUrl();
$parsedFeed = $resource->getFeed();