]> git.wh0rd.org Git - tt-rss.git/commitdiff
remove obsolete entries from ccache on login
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 22 Mar 2013 06:24:30 +0000 (10:24 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 22 Mar 2013 06:24:30 +0000 (10:24 +0400)
include/functions.php

index 238ba0121e8d51a6498684851e25c088b22cfa16..355fcd32ba7505f5b193e9a32634013f85e092ca 100644 (file)
                        if ($_SESSION["uid"]) {
                                cache_prefs($link);
                                load_user_plugins($link, $_SESSION["uid"]);
+
+                               /* cleanup ccache */
+
+                               db_query($link, "DELETE FROM ttrss_counters_cache WHERE owner_uid = ".
+                                       $_SESSION["uid"] . " AND
+                                               (SELECT COUNT(id) FROM ttrss_feeds WHERE
+                                                       ttrss_feeds.id = feed_id) = 0");
+
+                               db_query($link, "DELETE FROM ttrss_cat_counters_cache WHERE owner_uid = ".
+                                       $_SESSION["uid"] . " AND
+                                               (SELECT COUNT(id) FROM ttrss_feed_categories WHERE
+                                                       ttrss_feed_categories.id = feed_id) = 0");
+
                        }
+
                }
        }