diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2020-12-09 22:13:09 +0100 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2020-12-15 20:02:21 +0100 |
commit | 42ea24f2f41ce04588aa929e5ffdaf1dbeb1a700 (patch) | |
tree | 657089d619d1ee76d8f86dbf8553f9ce86c6867d /lib/Service | |
parent | 1345cedd7e226c23a9fff6275a0fb71e444aa1b3 (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/Service')
-rw-r--r-- | lib/Service/ItemServiceV2.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Service/ItemServiceV2.php b/lib/Service/ItemServiceV2.php index d0093a07e..0a04fd8ad 100644 --- a/lib/Service/ItemServiceV2.php +++ b/lib/Service/ItemServiceV2.php @@ -87,6 +87,13 @@ class ItemServiceV2 extends Service ->setStarred($db_item->isStarred()) ->setId($db_item->getId()); + $item->generateSearchIndex(); + // We don't want to update the database record if there is no + // change in the fetched item + if ($db_item->getFingerprint() === $item->getFingerprint()) { + $item->resetUpdatedFields(); + } + $this->mapper->update($item); } catch (DoesNotExistException $exception) { $this->mapper->insert($item); |