diff options
author | Andrew Dolgov <[email protected]> | 2013-03-22 10:24:30 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-22 10:24:30 +0400 |
commit | b1b1d25f50f6d4df0cea2aaf20f08944563d6e58 (patch) | |
tree | 8be559840bee71f3b1731e8cc4d53d40be7b34d6 /include/functions.php | |
parent | 5defc29ff832d4c7bfb40cab0df1a34d0664409f (diff) |
remove obsolete entries from ccache on login
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php index 238ba0121..355fcd32b 100644 --- a/include/functions.php +++ b/include/functions.php @@ -778,7 +778,21 @@ 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"); + } + } } |