diff options
Diffstat (limited to 'internal/config')
-rw-r--r-- | internal/config/config.go | 1 | ||||
-rw-r--r-- | internal/config/defaults.go | 1 | ||||
-rw-r--r-- | internal/config/helpers.gen.go | 25 |
3 files changed, 27 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index f4ea64f93..a6d27217f 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -195,6 +195,7 @@ type CacheConfiguration struct { MemoryTarget bytesize.Size `name:"memory-target"` AccountMemRatio float64 `name:"account-mem-ratio"` AccountNoteMemRatio float64 `name:"account-note-mem-ratio"` + AccountSettingsMemRatio float64 `name:"account-settings-mem-ratio"` ApplicationMemRatio float64 `name:"application-mem-ratio"` BlockMemRatio float64 `name:"block-mem-ratio"` BlockIDsMemRatio float64 `name:"block-mem-ratio"` diff --git a/internal/config/defaults.go b/internal/config/defaults.go index 6ca508d5a..99a2e24cb 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -159,6 +159,7 @@ var Defaults = Configuration{ // be able to make some more sense :D AccountMemRatio: 5, AccountNoteMemRatio: 1, + AccountSettingsMemRatio: 0.1, ApplicationMemRatio: 0.1, BlockMemRatio: 2, BlockIDsMemRatio: 3, diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index 5f65a6e28..39c163d20 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -2825,6 +2825,31 @@ func GetCacheAccountNoteMemRatio() float64 { return global.GetCacheAccountNoteMe // SetCacheAccountNoteMemRatio safely sets the value for global configuration 'Cache.AccountNoteMemRatio' field func SetCacheAccountNoteMemRatio(v float64) { global.SetCacheAccountNoteMemRatio(v) } +// GetCacheAccountSettingsMemRatio safely fetches the Configuration value for state's 'Cache.AccountSettingsMemRatio' field +func (st *ConfigState) GetCacheAccountSettingsMemRatio() (v float64) { + st.mutex.RLock() + v = st.config.Cache.AccountSettingsMemRatio + st.mutex.RUnlock() + return +} + +// SetCacheAccountSettingsMemRatio safely sets the Configuration value for state's 'Cache.AccountSettingsMemRatio' field +func (st *ConfigState) SetCacheAccountSettingsMemRatio(v float64) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.AccountSettingsMemRatio = v + st.reloadToViper() +} + +// CacheAccountSettingsMemRatioFlag returns the flag name for the 'Cache.AccountSettingsMemRatio' field +func CacheAccountSettingsMemRatioFlag() string { return "cache-account-settings-mem-ratio" } + +// GetCacheAccountSettingsMemRatio safely fetches the value for global configuration 'Cache.AccountSettingsMemRatio' field +func GetCacheAccountSettingsMemRatio() float64 { return global.GetCacheAccountSettingsMemRatio() } + +// SetCacheAccountSettingsMemRatio safely sets the value for global configuration 'Cache.AccountSettingsMemRatio' field +func SetCacheAccountSettingsMemRatio(v float64) { global.SetCacheAccountSettingsMemRatio(v) } + // GetCacheApplicationMemRatio safely fetches the Configuration value for state's 'Cache.ApplicationMemRatio' field func (st *ConfigState) GetCacheApplicationMemRatio() (v float64) { st.mutex.RLock() |