summaryrefslogtreecommitdiff
path: root/internal/cache/size.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-06-06 10:44:43 +0000
committerLibravatar GitHub <noreply@github.com>2024-06-06 11:44:43 +0100
commit5dcc954072ca0a27107ed3fdc6806986f61df7d0 (patch)
tree7a6380bf39e99dbcfee4fbe1434697706637d2bc /internal/cache/size.go
parent[bugfix] Don't nil emojis + fields on blocked accounts (#2968) (diff)
downloadgotosocial-5dcc954072ca0a27107ed3fdc6806986f61df7d0.tar.xz
[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
Diffstat (limited to 'internal/cache/size.go')
-rw-r--r--internal/cache/size.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/internal/cache/size.go b/internal/cache/size.go
index 758d191be..e205bf023 100644
--- a/internal/cache/size.go
+++ b/internal/cache/size.go
@@ -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(&gtsmodel.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(&gtsmodel.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(&gtsmodel.StatusFave{
ID: exampleID,