mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 06:12:25 -05:00
[performance] add caching of status fave, boost of, in reply to ID lists (#2060)
This commit is contained in:
parent
00adf18c24
commit
9a291dea84
27 changed files with 610 additions and 406 deletions
15
internal/cache/cache.go
vendored
15
internal/cache/cache.go
vendored
|
|
@ -196,6 +196,21 @@ func (c *Caches) setuphooks() {
|
|||
// c.GTS.Media().Invalidate("StatusID") will not work.
|
||||
c.GTS.Media().Invalidate("ID", id)
|
||||
}
|
||||
|
||||
if status.BoostOfID != "" {
|
||||
// Invalidate boost ID list of the original status.
|
||||
c.GTS.BoostOfIDs().Invalidate(status.BoostOfID)
|
||||
}
|
||||
|
||||
if status.InReplyToID != "" {
|
||||
// Invalidate in reply to ID list of original status.
|
||||
c.GTS.InReplyToIDs().Invalidate(status.InReplyToID)
|
||||
}
|
||||
})
|
||||
|
||||
c.GTS.StatusFave().SetInvalidateCallback(func(fave *gtsmodel.StatusFave) {
|
||||
// Invalidate status fave ID list for this status.
|
||||
c.GTS.StatusFaveIDs().Invalidate(fave.StatusID)
|
||||
})
|
||||
|
||||
c.GTS.User().SetInvalidateCallback(func(user *gtsmodel.User) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue