Merge pull request #4772 from pixelfed/staging

Update HashtagService, improve count perf
pull/4825/head
daniel 2023-11-15 23:24:46 -07:00 zatwierdzone przez GitHub
commit 23dea20024
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -51,6 +51,9 @@
- Update mail config ([0e431271](https://github.com/pixelfed/pixelfed/commit/0e431271))
- Update hashtag following ([015b1b80](https://github.com/pixelfed/pixelfed/commit/015b1b80))
- Update IncrementPostCount job, prevent overlap ([b2c9cc23](https://github.com/pixelfed/pixelfed/commit/b2c9cc23))
- Update HashtagFollowService, fix cache invalidation bug ([84f4e885](https://github.com/pixelfed/pixelfed/commit/84f4e885))
- Update Experimental Home Feed, fix remote posts, shares and reblogs ([c6a6b3ae](https://github.com/pixelfed/pixelfed/commit/c6a6b3ae))
- Update HashtagService, improve count perf ([3327a008](https://github.com/pixelfed/pixelfed/commit/3327a008))
- ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.9 (2023-08-21)](https://github.com/pixelfed/pixelfed/compare/v0.11.8...v0.11.9)

Wyświetl plik

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