]> git.mxchange.org Git - friendica.git/commitdiff
Use period and limit in the cache key
authorMichael <heluecht@pirati.ca>
Sat, 26 Sep 2020 12:16:46 +0000 (12:16 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 26 Sep 2020 12:16:46 +0000 (12:16 +0000)
src/Model/Tag.php

index f5932dd6029335c3b27c5a67fbd4db042fa69961..0d6c9cfb5106b33a72599f3d0e22f331716b9c12 100644 (file)
@@ -494,7 +494,7 @@ class Tag
         */
        public static function getGlobalTrendingHashtags(int $period, $limit = 10)
        {
-               $tags = DI::cache()->get('global_trending_tags');
+               $tags = DI::cache()->get('global_trending_tags-' . $period . '-' . $limit);
                if (!empty($tags)) {
                        return $tags;
                } else {
@@ -520,7 +520,7 @@ class Tag
 
                if (DBA::isResult($tagsStmt)) {
                        $tags = DBA::toArray($tagsStmt);
-                       DI::cache()->set('global_trending_tags', $tags, Duration::HOUR);
+                       DI::cache()->set('global_trending_tags-' . $period . '-' . $limit, $tags, Duration::HOUR);
                        return $tags;
                }