mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 13:42:24 -05:00
[feature] do not uncache status / emoji media if attached status is bookmarked (#2956)
* do not uncache status / emoji media if attached status is bookmarked
* add status bookmark and bookmark IDs caches
* update status bookmark tests
* move IsStatusBookmarkedBy() to StatusBookmark{} interface, rely on cache
* fix envparsing.sh test
This commit is contained in:
parent
6f26b32ec3
commit
5dcc954072
17 changed files with 501 additions and 215 deletions
5
internal/cache/invalidate.go
vendored
5
internal/cache/invalidate.go
vendored
|
|
@ -198,6 +198,11 @@ func (c *Caches) OnInvalidateStatus(status *gtsmodel.Status) {
|
|||
}
|
||||
}
|
||||
|
||||
func (c *Caches) OnInvalidateStatusBookmark(bookmark *gtsmodel.StatusBookmark) {
|
||||
// Invalidate status bookmark ID list for this status.
|
||||
c.GTS.StatusBookmarkIDs.Invalidate(bookmark.StatusID)
|
||||
}
|
||||
|
||||
func (c *Caches) OnInvalidateStatusFave(fave *gtsmodel.StatusFave) {
|
||||
// Invalidate status fave ID list for this status.
|
||||
c.GTS.StatusFaveIDs.Invalidate(fave.StatusID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue