From f456bd3401859eb6ea15e48cc6e117c46703ffd1 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Mon, 6 May 2024 21:29:31 +0000 Subject: [PATCH] update the total ratios calculation to include ALL caches (previously was missing a few!) (#2907) --- internal/cache/db.go | 6 +++--- internal/cache/size.go | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/internal/cache/db.go b/internal/cache/db.go index d993d6143..4ce541770 100644 --- a/internal/cache/db.go +++ b/internal/cache/db.go @@ -148,15 +148,15 @@ type GTSCaches struct { // Tag provides access to the gtsmodel Tag database cache. Tag StructCache[*gtsmodel.Tag] + // ThreadMute provides access to the gtsmodel ThreadMute database cache. + ThreadMute StructCache[*gtsmodel.ThreadMute] + // Token provides access to the gtsmodel Token database cache. Token StructCache[*gtsmodel.Token] // Tombstone provides access to the gtsmodel Tombstone database cache. Tombstone StructCache[*gtsmodel.Tombstone] - // ThreadMute provides access to the gtsmodel ThreadMute database cache. - ThreadMute StructCache[*gtsmodel.ThreadMute] - // User provides access to the gtsmodel User database cache. User StructCache[*gtsmodel.User] diff --git a/internal/cache/size.go b/internal/cache/size.go index 5bd99c3d8..758d191be 100644 --- a/internal/cache/size.go +++ b/internal/cache/size.go @@ -172,6 +172,8 @@ func totalOfRatios() float64 { return 0 + config.GetCacheAccountMemRatio() + config.GetCacheAccountNoteMemRatio() + + config.GetCacheAccountSettingsMemRatio() + + config.GetCacheAccountStatsMemRatio() + config.GetCacheApplicationMemRatio() + config.GetCacheBlockMemRatio() + config.GetCacheBlockIDsMemRatio() + @@ -179,17 +181,21 @@ func totalOfRatios() float64 { config.GetCacheClientMemRatio() + config.GetCacheEmojiMemRatio() + config.GetCacheEmojiCategoryMemRatio() + + config.GetCacheFilterMemRatio() + + config.GetCacheFilterKeywordMemRatio() + + config.GetCacheFilterStatusMemRatio() + config.GetCacheFollowMemRatio() + config.GetCacheFollowIDsMemRatio() + config.GetCacheFollowRequestMemRatio() + config.GetCacheFollowRequestIDsMemRatio() + - config.GetCacheInReplyToIDsMemRatio() + config.GetCacheInstanceMemRatio() + + config.GetCacheInReplyToIDsMemRatio() + config.GetCacheListMemRatio() + config.GetCacheListEntryMemRatio() + config.GetCacheMarkerMemRatio() + config.GetCacheMediaMemRatio() + config.GetCacheMentionMemRatio() + + config.GetCacheMoveMemRatio() + config.GetCacheNotificationMemRatio() + config.GetCachePollMemRatio() + config.GetCachePollVoteMemRatio() +