sforkowany z mirror/friendica
Merge pull request #9294 from annando/tag-cache
Tags: Use the parameters for the cache key2022.09-rc
commit
31630099ff
|
@ -537,7 +537,7 @@ class Tag
|
||||||
*/
|
*/
|
||||||
public static function getLocalTrendingHashtags(int $period, $limit = 10)
|
public static function getLocalTrendingHashtags(int $period, $limit = 10)
|
||||||
{
|
{
|
||||||
$tags = DI::cache()->get('local_trending_tags');
|
$tags = DI::cache()->get('local_trending_tags-' . $period . '-' . $limit);
|
||||||
if (!empty($tags)) {
|
if (!empty($tags)) {
|
||||||
return $tags;
|
return $tags;
|
||||||
} else {
|
} else {
|
||||||
|
@ -563,7 +563,7 @@ class Tag
|
||||||
|
|
||||||
if (DBA::isResult($tagsStmt)) {
|
if (DBA::isResult($tagsStmt)) {
|
||||||
$tags = DBA::toArray($tagsStmt);
|
$tags = DBA::toArray($tagsStmt);
|
||||||
DI::cache()->set('local_trending_tags', $tags, Duration::HOUR);
|
DI::cache()->set('local_trending_tags-' . $period . '-' . $limit, $tags, Duration::HOUR);
|
||||||
return $tags;
|
return $tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue