summaryrefslogtreecommitdiff
path: root/classes/rssutils.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-01-24 14:25:31 +0300
committerAndrew Dolgov <[email protected]>2020-01-24 14:25:31 +0300
commit6080cca9ca1de60a5d4a1ef06d4873eca07d9ef2 (patch)
tree3a59a6803fbb38067746895bfcb277d2db688e81 /classes/rssutils.php
parenta6d314b753d7e79da06c733efd5a96caf9b5f562 (diff)
scrap counter cache system; rework counters to sum() booleans instead
Diffstat (limited to 'classes/rssutils.php')
-rwxr-xr-xclasses/rssutils.php20
1 files changed, 3 insertions, 17 deletions
diff --git a/classes/rssutils.php b/classes/rssutils.php
index 66008899b..831ac1baf 100755
--- a/classes/rssutils.php
+++ b/classes/rssutils.php
@@ -1469,26 +1469,12 @@ class RSSUtils {
mb_strtolower(strip_tags($title), 'utf-8'));
}
+ /* counter cache is no longer used, if called truncate leftover data */
static function cleanup_counters_cache() {
$pdo = Db::pdo();
- $res = $pdo->query("DELETE FROM ttrss_counters_cache
- WHERE feed_id > 0 AND
- (SELECT COUNT(id) FROM ttrss_feeds WHERE
- id = feed_id AND
- ttrss_counters_cache.owner_uid = ttrss_feeds.owner_uid) = 0");
-
- $frows = $res->rowCount();
-
- $res = $pdo->query("DELETE FROM ttrss_cat_counters_cache
- WHERE feed_id > 0 AND
- (SELECT COUNT(id) FROM ttrss_feed_categories WHERE
- id = feed_id AND
- ttrss_cat_counters_cache.owner_uid = ttrss_feed_categories.owner_uid) = 0");
-
- $crows = $res->rowCount();
-
- Debug::log("Removed $frows (feeds) $crows (cats) orphaned counter cache entries.");
+ $pdo->query("DELETE FROM ttrss_counters_cache");
+ $pdo->query("DELETE FROM ttrss_cat_counters_cache");
}
static function housekeeping_user($owner_uid) {