diff options
| author | 2023-06-16 16:11:16 +0200 | |
|---|---|---|
| committer | 2023-06-16 16:11:16 +0200 | |
| commit | 723f7577d0a388a90779930754c5aacb9f66b168 (patch) | |
| tree | aa863f67592d0795be83b533de981082e0713601 /app/Models/FeedDAO.php | |
| parent | 228d7adfdb90c3fdd179f80fbfde565eb06e0cec (diff) | |
Refactor lastSeen and markReadAsGone (#5470)
* Refactor lastSeen and markReadAsGone
Make the logic a bit more robust and explicit
* Remove forgotten SQL param
* Add test inTransaction
* More robust transaction
* Add a debug log
* Add max timestamp to markAsReadUponGone
* Reduce number of debug lines
* typing
* Better detection of when feed is empty
* More explicit case for push
Diffstat (limited to 'app/Models/FeedDAO.php')
| -rw-r--r-- | app/Models/FeedDAO.php | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index ec51486a6..b9295abe0 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -503,16 +503,12 @@ WHERE id_feed=:id_feed1 AND is_read=0 AND ( `lastSeen` + 60 < (SELECT s1.maxlastseen FROM ( SELECT MAX(e2.`lastSeen`) AS maxlastseen FROM `_entry` e2 WHERE e2.id_feed = :id_feed2 ) s1) - OR `lastSeen` + 60 < (SELECT s2.lastcorrectupdate FROM ( - SELECT f2.`lastUpdate` AS lastcorrectupdate FROM `_feed` f2 WHERE f2.id = :id_feed3 AND f2.error = 0 - ) s2) ) SQL; if (($stm = $this->pdo->prepare($sql)) && $stm->bindParam(':id_feed1', $id, PDO::PARAM_INT) && $stm->bindParam(':id_feed2', $id, PDO::PARAM_INT) && - $stm->bindParam(':id_feed3', $id, PDO::PARAM_INT) && $stm->execute()) { return $stm->rowCount(); } else { |
