From 42ea24f2f41ce04588aa929e5ffdaf1dbeb1a700 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Wed, 9 Dec 2020 22:13:09 +0100 Subject: 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 --- lib/Db/NewsMapperV2.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Db') diff --git a/lib/Db/NewsMapperV2.php b/lib/Db/NewsMapperV2.php index 708ef4f73..93500c7c9 100644 --- a/lib/Db/NewsMapperV2.php +++ b/lib/Db/NewsMapperV2.php @@ -58,7 +58,9 @@ abstract class NewsMapperV2 extends QBMapper public function update(Entity $entity): Entity { - $entity->setLastModified($this->time->getMicroTime()); + if ([] !== $entity->getUpdatedFields()) { + $entity->setLastModified($this->time->getMicroTime()); + } return parent::update($entity); } -- cgit v1.2.3