diff options
Diffstat (limited to 'internal/config')
-rw-r--r-- | internal/config/config.go | 2 | ||||
-rw-r--r-- | internal/config/defaults.go | 2 | ||||
-rw-r--r-- | internal/config/helpers.gen.go | 62 |
3 files changed, 66 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 1b8cf2759..a6499d822 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -193,6 +193,7 @@ type HTTPClientConfiguration struct { type CacheConfiguration struct { MemoryTarget bytesize.Size `name:"memory-target"` AccountMemRatio float64 `name:"account-mem-ratio"` + AccountIDsFollowingTagMemRatio float64 `name:"account-ids-following-tag-mem-ratio"` AccountNoteMemRatio float64 `name:"account-note-mem-ratio"` AccountSettingsMemRatio float64 `name:"account-settings-mem-ratio"` AccountStatsMemRatio float64 `name:"account-stats-mem-ratio"` @@ -232,6 +233,7 @@ type CacheConfiguration struct { StatusFaveMemRatio float64 `name:"status-fave-mem-ratio"` StatusFaveIDsMemRatio float64 `name:"status-fave-ids-mem-ratio"` TagMemRatio float64 `name:"tag-mem-ratio"` + TagIDsFollowedByAccountMemRatio float64 `name:"tag-ids-followed-by-account-mem-ratio"` ThreadMuteMemRatio float64 `name:"thread-mute-mem-ratio"` TokenMemRatio float64 `name:"token-mem-ratio"` TombstoneMemRatio float64 `name:"tombstone-mem-ratio"` diff --git a/internal/config/defaults.go b/internal/config/defaults.go index 82ea07e10..835841c84 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -157,6 +157,7 @@ var Defaults = Configuration{ // file have been addressed, these should // be able to make some more sense :D AccountMemRatio: 5, + AccountIDsFollowingTagMemRatio: 1, AccountNoteMemRatio: 1, AccountSettingsMemRatio: 0.1, AccountStatsMemRatio: 2, @@ -196,6 +197,7 @@ var Defaults = Configuration{ StatusFaveMemRatio: 2, StatusFaveIDsMemRatio: 3, TagMemRatio: 2, + TagIDsFollowedByAccountMemRatio: 1, ThreadMuteMemRatio: 0.2, TokenMemRatio: 0.75, TombstoneMemRatio: 0.5, diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index 932cb802d..587fba364 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -2775,6 +2775,37 @@ func GetCacheAccountMemRatio() float64 { return global.GetCacheAccountMemRatio() // SetCacheAccountMemRatio safely sets the value for global configuration 'Cache.AccountMemRatio' field func SetCacheAccountMemRatio(v float64) { global.SetCacheAccountMemRatio(v) } +// GetCacheAccountIDsFollowingTagMemRatio safely fetches the Configuration value for state's 'Cache.AccountIDsFollowingTagMemRatio' field +func (st *ConfigState) GetCacheAccountIDsFollowingTagMemRatio() (v float64) { + st.mutex.RLock() + v = st.config.Cache.AccountIDsFollowingTagMemRatio + st.mutex.RUnlock() + return +} + +// SetCacheAccountIDsFollowingTagMemRatio safely sets the Configuration value for state's 'Cache.AccountIDsFollowingTagMemRatio' field +func (st *ConfigState) SetCacheAccountIDsFollowingTagMemRatio(v float64) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.AccountIDsFollowingTagMemRatio = v + st.reloadToViper() +} + +// CacheAccountIDsFollowingTagMemRatioFlag returns the flag name for the 'Cache.AccountIDsFollowingTagMemRatio' field +func CacheAccountIDsFollowingTagMemRatioFlag() string { + return "cache-account-ids-following-tag-mem-ratio" +} + +// GetCacheAccountIDsFollowingTagMemRatio safely fetches the value for global configuration 'Cache.AccountIDsFollowingTagMemRatio' field +func GetCacheAccountIDsFollowingTagMemRatio() float64 { + return global.GetCacheAccountIDsFollowingTagMemRatio() +} + +// SetCacheAccountIDsFollowingTagMemRatio safely sets the value for global configuration 'Cache.AccountIDsFollowingTagMemRatio' field +func SetCacheAccountIDsFollowingTagMemRatio(v float64) { + global.SetCacheAccountIDsFollowingTagMemRatio(v) +} + // GetCacheAccountNoteMemRatio safely fetches the Configuration value for state's 'Cache.AccountNoteMemRatio' field func (st *ConfigState) GetCacheAccountNoteMemRatio() (v float64) { st.mutex.RLock() @@ -3758,6 +3789,37 @@ func GetCacheTagMemRatio() float64 { return global.GetCacheTagMemRatio() } // SetCacheTagMemRatio safely sets the value for global configuration 'Cache.TagMemRatio' field func SetCacheTagMemRatio(v float64) { global.SetCacheTagMemRatio(v) } +// GetCacheTagIDsFollowedByAccountMemRatio safely fetches the Configuration value for state's 'Cache.TagIDsFollowedByAccountMemRatio' field +func (st *ConfigState) GetCacheTagIDsFollowedByAccountMemRatio() (v float64) { + st.mutex.RLock() + v = st.config.Cache.TagIDsFollowedByAccountMemRatio + st.mutex.RUnlock() + return +} + +// SetCacheTagIDsFollowedByAccountMemRatio safely sets the Configuration value for state's 'Cache.TagIDsFollowedByAccountMemRatio' field +func (st *ConfigState) SetCacheTagIDsFollowedByAccountMemRatio(v float64) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.TagIDsFollowedByAccountMemRatio = v + st.reloadToViper() +} + +// CacheTagIDsFollowedByAccountMemRatioFlag returns the flag name for the 'Cache.TagIDsFollowedByAccountMemRatio' field +func CacheTagIDsFollowedByAccountMemRatioFlag() string { + return "cache-tag-ids-followed-by-account-mem-ratio" +} + +// GetCacheTagIDsFollowedByAccountMemRatio safely fetches the value for global configuration 'Cache.TagIDsFollowedByAccountMemRatio' field +func GetCacheTagIDsFollowedByAccountMemRatio() float64 { + return global.GetCacheTagIDsFollowedByAccountMemRatio() +} + +// SetCacheTagIDsFollowedByAccountMemRatio safely sets the value for global configuration 'Cache.TagIDsFollowedByAccountMemRatio' field +func SetCacheTagIDsFollowedByAccountMemRatio(v float64) { + global.SetCacheTagIDsFollowedByAccountMemRatio(v) +} + // GetCacheThreadMuteMemRatio safely fetches the Configuration value for state's 'Cache.ThreadMuteMemRatio' field func (st *ConfigState) GetCacheThreadMuteMemRatio() (v float64) { st.mutex.RLock() |