From 5dcc954072ca0a27107ed3fdc6806986f61df7d0 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:44:43 +0000 Subject: [feature] do not uncache status / emoji media if attached status is bookmarked (#2956) * do not uncache status / emoji media if attached status is bookmarked * add status bookmark and bookmark IDs caches * update status bookmark tests * move IsStatusBookmarkedBy() to StatusBookmark{} interface, rely on cache * fix envparsing.sh test --- internal/config/helpers.gen.go | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'internal/config/helpers.gen.go') diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index c986dd19d..2f37cbacb 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -3550,6 +3550,56 @@ func GetCacheStatusMemRatio() float64 { return global.GetCacheStatusMemRatio() } // SetCacheStatusMemRatio safely sets the value for global configuration 'Cache.StatusMemRatio' field func SetCacheStatusMemRatio(v float64) { global.SetCacheStatusMemRatio(v) } +// GetCacheStatusBookmarkMemRatio safely fetches the Configuration value for state's 'Cache.StatusBookmarkMemRatio' field +func (st *ConfigState) GetCacheStatusBookmarkMemRatio() (v float64) { + st.mutex.RLock() + v = st.config.Cache.StatusBookmarkMemRatio + st.mutex.RUnlock() + return +} + +// SetCacheStatusBookmarkMemRatio safely sets the Configuration value for state's 'Cache.StatusBookmarkMemRatio' field +func (st *ConfigState) SetCacheStatusBookmarkMemRatio(v float64) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.StatusBookmarkMemRatio = v + st.reloadToViper() +} + +// CacheStatusBookmarkMemRatioFlag returns the flag name for the 'Cache.StatusBookmarkMemRatio' field +func CacheStatusBookmarkMemRatioFlag() string { return "cache-status-bookmark-mem-ratio" } + +// GetCacheStatusBookmarkMemRatio safely fetches the value for global configuration 'Cache.StatusBookmarkMemRatio' field +func GetCacheStatusBookmarkMemRatio() float64 { return global.GetCacheStatusBookmarkMemRatio() } + +// SetCacheStatusBookmarkMemRatio safely sets the value for global configuration 'Cache.StatusBookmarkMemRatio' field +func SetCacheStatusBookmarkMemRatio(v float64) { global.SetCacheStatusBookmarkMemRatio(v) } + +// GetCacheStatusBookmarkIDsMemRatio safely fetches the Configuration value for state's 'Cache.StatusBookmarkIDsMemRatio' field +func (st *ConfigState) GetCacheStatusBookmarkIDsMemRatio() (v float64) { + st.mutex.RLock() + v = st.config.Cache.StatusBookmarkIDsMemRatio + st.mutex.RUnlock() + return +} + +// SetCacheStatusBookmarkIDsMemRatio safely sets the Configuration value for state's 'Cache.StatusBookmarkIDsMemRatio' field +func (st *ConfigState) SetCacheStatusBookmarkIDsMemRatio(v float64) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.Cache.StatusBookmarkIDsMemRatio = v + st.reloadToViper() +} + +// CacheStatusBookmarkIDsMemRatioFlag returns the flag name for the 'Cache.StatusBookmarkIDsMemRatio' field +func CacheStatusBookmarkIDsMemRatioFlag() string { return "cache-status-bookmark-ids-mem-ratio" } + +// GetCacheStatusBookmarkIDsMemRatio safely fetches the value for global configuration 'Cache.StatusBookmarkIDsMemRatio' field +func GetCacheStatusBookmarkIDsMemRatio() float64 { return global.GetCacheStatusBookmarkIDsMemRatio() } + +// SetCacheStatusBookmarkIDsMemRatio safely sets the value for global configuration 'Cache.StatusBookmarkIDsMemRatio' field +func SetCacheStatusBookmarkIDsMemRatio(v float64) { global.SetCacheStatusBookmarkIDsMemRatio(v) } + // GetCacheStatusFaveMemRatio safely fetches the Configuration value for state's 'Cache.StatusFaveMemRatio' field func (st *ConfigState) GetCacheStatusFaveMemRatio() (v float64) { st.mutex.RLock() -- cgit v1.2.3