summaryrefslogtreecommitdiff
path: root/internal/cache/size.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-07-11 16:44:29 +0200
committerLibravatar GitHub <noreply@github.com>2024-07-11 15:44:29 +0100
commit5bc567196bf2204272950c525e8592e56057c3bd (patch)
tree24aec5e75d2a0208505da16ee2c55efd887d3e25 /internal/cache/size.go
parent[bugfix] Don't throw error when parent statuses are missing (#2011) (#3088) (diff)
downloadgotosocial-5bc567196bf2204272950c525e8592e56057c3bd.tar.xz
[chore] Add interaction policy gtsmodels (#3075)
* [chore] introduce interaction policy gts models * update migration a smidge * fix copy paste typo * update migration * use int for InteractionType
Diffstat (limited to 'internal/cache/size.go')
-rw-r--r--internal/cache/size.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/internal/cache/size.go b/internal/cache/size.go
index fb1f165c2..4ec30fbb7 100644
--- a/internal/cache/size.go
+++ b/internal/cache/size.go
@@ -189,6 +189,7 @@ func totalOfRatios() float64 {
config.GetCacheFollowRequestMemRatio() +
config.GetCacheFollowRequestIDsMemRatio() +
config.GetCacheInstanceMemRatio() +
+ config.GetCacheInteractionApprovalMemRatio() +
config.GetCacheInReplyToIDsMemRatio() +
config.GetCacheListMemRatio() +
config.GetCacheListEntryMemRatio() +
@@ -425,6 +426,19 @@ func sizeofInstance() uintptr {
}))
}
+func sizeofInteractionApproval() uintptr {
+ return uintptr(size.Of(&gtsmodel.InteractionApproval{
+ ID: exampleID,
+ CreatedAt: exampleTime,
+ UpdatedAt: exampleTime,
+ AccountID: exampleID,
+ InteractingAccountID: exampleID,
+ InteractionURI: exampleURI,
+ InteractionType: gtsmodel.InteractionAnnounce,
+ URI: exampleURI,
+ }))
+}
+
func sizeofList() uintptr {
return uintptr(size.Of(&gtsmodel.List{
ID: exampleID,
@@ -591,9 +605,6 @@ func sizeofStatus() uintptr {
Language: "en",
CreatedWithApplicationID: exampleID,
Federated: func() *bool { ok := true; return &ok }(),
- Boostable: func() *bool { ok := true; return &ok }(),
- Replyable: func() *bool { ok := true; return &ok }(),
- Likeable: func() *bool { ok := true; return &ok }(),
ActivityStreamsType: ap.ObjectNote,
}))
}