mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update HashtagService, improve count perf
This commit is contained in:
parent
3e96fa8a56
commit
3327a008fa
1 changed files with 3 additions and 2 deletions
|
@ -29,8 +29,9 @@ class HashtagService
|
|||
|
||||
public static function count($id)
|
||||
{
|
||||
return Cache::remember('services:hashtag:public-count:by_id:' . $id, 86400, function() use($id) {
|
||||
return StatusHashtag::whereHashtagId($id)->whereStatusVisibility('public')->count();
|
||||
return Cache::remember('services:hashtag:public-count:by_id:' . $id, 3600, function() use($id) {
|
||||
$tag = Hashtag::find($id);
|
||||
return $tag ? $tag->cached_count ?? 0 : 0;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue