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 ea84a4af7..f4ea64f93 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -215,6 +215,7 @@ type CacheConfiguration struct { MarkerMemRatio float64 `name:"marker-mem-ratio"` MediaMemRatio float64 `name:"media-mem-ratio"` MentionMemRatio float64 `name:"mention-mem-ratio"` + MoveMemRatio float64 `name:"move-mem-ratio"` NotificationMemRatio float64 `name:"notification-mem-ratio"` PollMemRatio float64 `name:"poll-mem-ratio"` PollVoteMemRatio float64 `name:"poll-vote-mem-ratio"` diff --git a/internal/config/defaults.go b/internal/config/defaults.go index c98b54b0b..6ca508d5a 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -179,6 +179,7 @@ var Defaults = Configuration{ MarkerMemRatio: 0.5, MediaMemRatio: 4, MentionMemRatio: 2, + MoveMemRatio: 0.1, NotificationMemRatio: 2, PollMemRatio: 1, PollVoteMemRatio: 2, diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index c5d4c992b..5f65a6e28 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -3325,6 +3325,31 @@ func GetCacheMentionMemRatio() float64 { return global.GetCacheMentionMemRatio() // SetCacheMentionMemRatio safely sets the value for global configuration 'Cache.MentionMemRatio' field func SetCacheMentionMemRatio(v float64) { global.SetCacheMentionMemRatio(v) } +// GetCacheMoveMemRatio safely fetches the Configuration value for state's 'Cache.MoveMemRatio' field +func (st *ConfigState) GetCacheMoveMemRatio() (v float64) { + st.mutex.RLock() + v = st.config.Cache.MoveMemRatio + st.mutex.RUnlock() + return +} + +// SetCacheMoveMemRatio safely sets the Configuration value for state's 'Cache.MoveMemRatio' field +func (st *ConfigState) SetCacheMoveMemRatio(v float64) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.MoveMemRatio = v + st.reloadToViper() +} + +// CacheMoveMemRatioFlag returns the flag name for the 'Cache.MoveMemRatio' field +func CacheMoveMemRatioFlag() string { return "cache-move-mem-ratio" } + +// GetCacheMoveMemRatio safely fetches the value for global configuration 'Cache.MoveMemRatio' field +func GetCacheMoveMemRatio() float64 { return global.GetCacheMoveMemRatio() } + +// SetCacheMoveMemRatio safely sets the value for global configuration 'Cache.MoveMemRatio' field +func SetCacheMoveMemRatio(v float64) { global.SetCacheMoveMemRatio(v) } + // GetCacheNotificationMemRatio safely fetches the Configuration value for state's 'Cache.NotificationMemRatio' field func (st *ConfigState) GetCacheNotificationMemRatio() (v float64) { st.mutex.RLock() |