summaryrefslogtreecommitdiff
path: root/internal/cache/invalidate.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-04-16 13:10:13 +0200
committerLibravatar GitHub <noreply@github.com>2024-04-16 13:10:13 +0200
commit3cceed11b28b5f42a653d85ed779d652fd8c26ad (patch)
tree0a7f0994e477609ca705a45f382dfb62056b196e /internal/cache/invalidate.go
parent[performance] cached oauth database types (#2838) (diff)
downloadgotosocial-3cceed11b28b5f42a653d85ed779d652fd8c26ad.tar.xz
[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
Diffstat (limited to 'internal/cache/invalidate.go')
-rw-r--r--internal/cache/invalidate.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/cache/invalidate.go b/internal/cache/invalidate.go
index 547015eac..01d332d40 100644
--- a/internal/cache/invalidate.go
+++ b/internal/cache/invalidate.go
@@ -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)