remove obsolete entries from ccache on login

This commit is contained in:
Andrew Dolgov 2013-03-22 10:24:30 +04:00
parent 5defc29ff8
commit b1b1d25f50
1 changed files with 14 additions and 0 deletions

View File

@ -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");
}
}
}