diff options
author | 2023-11-08 14:32:17 +0000 | |
---|---|---|
committer | 2023-11-08 14:32:17 +0000 | |
commit | e9e5dc5a40926e5320cb131b035c46b1e1b0bd59 (patch) | |
tree | 52edc9fa5742f28e1e5223f51cda628ec1c35a24 /internal/cache/size.go | |
parent | [chore]: Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2338) (diff) | |
download | gotosocial-e9e5dc5a40926e5320cb131b035c46b1e1b0bd59.tar.xz |
[feature] add support for polls + receiving federated status edits (#2330)
Diffstat (limited to 'internal/cache/size.go')
-rw-r--r-- | internal/cache/size.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/cache/size.go b/internal/cache/size.go index 3e77c68ac..62fb31469 100644 --- a/internal/cache/size.go +++ b/internal/cache/size.go @@ -189,6 +189,8 @@ func totalOfRatios() float64 { config.GetCacheMediaMemRatio() + config.GetCacheMentionMemRatio() + config.GetCacheNotificationMemRatio() + + config.GetCachePollMemRatio() + + config.GetCachePollVoteMemRatio() + config.GetCacheReportMemRatio() + config.GetCacheStatusMemRatio() + config.GetCacheStatusFaveMemRatio() + @@ -438,6 +440,27 @@ func sizeofNotification() uintptr { })) } +func sizeofPoll() uintptr { + return uintptr(size.Of(>smodel.Poll{ + ID: exampleID, + Multiple: func() *bool { ok := false; return &ok }(), + HideCounts: func() *bool { ok := false; return &ok }(), + Options: []string{exampleTextSmall, exampleTextSmall, exampleTextSmall, exampleTextSmall}, + StatusID: exampleID, + ExpiresAt: exampleTime, + })) +} + +func sizeofPollVote() uintptr { + return uintptr(size.Of(>smodel.PollVote{ + ID: exampleID, + Choices: []int{69, 420, 1337}, + AccountID: exampleID, + PollID: exampleID, + CreatedAt: exampleTime, + })) +} + func sizeofReport() uintptr { return uintptr(size.Of(>smodel.Report{ ID: exampleID, |