mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 18:42:26 -05:00
[feature/performance] Store account stats in separate table (#2831)
* [feature/performance] Store account stats in separate table, get stats from remote * test account stats * add some missing increment / decrement calls * change stats function signatures * rejig logging a bit * use lock when updating stats
This commit is contained in:
parent
f79d50b9b2
commit
3cceed11b2
43 changed files with 1285 additions and 450 deletions
8
internal/cache/invalidate.go
vendored
8
internal/cache/invalidate.go
vendored
|
|
@ -27,8 +27,8 @@ import (
|
|||
// HOOKS TO BE CALLED ON DELETE YOU MUST FIRST POPULATE IT IN THE CACHE.
|
||||
|
||||
func (c *Caches) OnInvalidateAccount(account *gtsmodel.Account) {
|
||||
// Invalidate status counts for this account.
|
||||
c.GTS.AccountCounts.Invalidate(account.ID)
|
||||
// Invalidate stats for this account.
|
||||
c.GTS.AccountStats.Invalidate("AccountID", account.ID)
|
||||
|
||||
// Invalidate account ID cached visibility.
|
||||
c.Visibility.Invalidate("ItemID", account.ID)
|
||||
|
|
@ -168,8 +168,8 @@ func (c *Caches) OnInvalidatePollVote(vote *gtsmodel.PollVote) {
|
|||
}
|
||||
|
||||
func (c *Caches) OnInvalidateStatus(status *gtsmodel.Status) {
|
||||
// Invalidate status counts for this account.
|
||||
c.GTS.AccountCounts.Invalidate(status.AccountID)
|
||||
// Invalidate stats for this account.
|
||||
c.GTS.AccountStats.Invalidate("AccountID", status.AccountID)
|
||||
|
||||
// Invalidate status ID cached visibility.
|
||||
c.Visibility.Invalidate("ItemID", status.ID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue