A free, self-hostable news aggregator…
Call cleanCache when refreshing feeds (#7827)
Alexandre Alapetiteade9ba881785
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.phpindex 97d68883c..4884b237f 100644--- a/app/Controllers/feedController.php+++ b/app/Controllers/feedController.php@@ -862,6 +862,9 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {if ($entryDAO->inTransaction()) {$entryDAO->commit();}+ if (rand(0, 30) === 1) { // Remove old cache once in a while+ cleanCache(CLEANCACHE_HOURS);+ }return [$nbUpdatedFeeds, $feed, $nbNewArticles, $feedsCacheToRefresh];}diff --git a/lib/lib_rss.php b/lib/lib_rss.phpindex 59e7abba0..c0fe17708 100644--- a/lib/lib_rss.php+++ b/lib/lib_rss.php@@ -557,7 +557,7 @@ function httpGet(string $url, string $cachePath, string $type = 'html', array $a}}- if (mt_rand(0, 30) === 1) { // Remove old entries once in a while+ if (rand(0, 30) === 1) { // Remove old cache once in a whilecleanCache(CLEANCACHE_HOURS);}