mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 12:22:25 -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
18
internal/cache/size.go
vendored
18
internal/cache/size.go
vendored
|
|
@ -201,6 +201,8 @@ func totalOfRatios() float64 {
|
|||
config.GetCachePollVoteMemRatio() +
|
||||
config.GetCacheReportMemRatio() +
|
||||
config.GetCacheStatusMemRatio() +
|
||||
config.GetCacheStatusBookmarkMemRatio() +
|
||||
config.GetCacheStatusBookmarkIDsMemRatio() +
|
||||
config.GetCacheStatusFaveMemRatio() +
|
||||
config.GetCacheStatusFaveIDsMemRatio() +
|
||||
config.GetCacheTagMemRatio() +
|
||||
|
|
@ -566,7 +568,7 @@ func sizeofReport() uintptr {
|
|||
|
||||
func sizeofStatus() uintptr {
|
||||
return uintptr(size.Of(>smodel.Status{
|
||||
ID: exampleURI,
|
||||
ID: exampleID,
|
||||
URI: exampleURI,
|
||||
URL: exampleURI,
|
||||
Content: exampleText,
|
||||
|
|
@ -599,6 +601,20 @@ func sizeofStatus() uintptr {
|
|||
}))
|
||||
}
|
||||
|
||||
func sizeofStatusBookmark() uintptr {
|
||||
return uintptr(size.Of(>smodel.StatusBookmark{
|
||||
ID: exampleID,
|
||||
AccountID: exampleID,
|
||||
Account: nil,
|
||||
TargetAccountID: exampleID,
|
||||
TargetAccount: nil,
|
||||
StatusID: exampleID,
|
||||
Status: nil,
|
||||
CreatedAt: exampleTime,
|
||||
UpdatedAt: exampleTime,
|
||||
}))
|
||||
}
|
||||
|
||||
func sizeofStatusFave() uintptr {
|
||||
return uintptr(size.Of(>smodel.StatusFave{
|
||||
ID: exampleID,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue