diff options
author | 2023-01-26 15:12:48 +0100 | |
---|---|---|
committer | 2023-01-26 15:12:48 +0100 | |
commit | 782169da765baf1d651c1b71e5f974f762c92d8e (patch) | |
tree | 073d78698a911af2ac37a2a64bf5ae57406fc38c /internal/config/helpers.gen.go | |
parent | [feature] Public list of suspended domains (#1362) (diff) | |
download | gotosocial-782169da765baf1d651c1b71e5f974f762c92d8e.tar.xz |
[chore] set max open / idle conns + conn max lifetime for both postgres and sqlite (#1369)
* [chore] set max open / idle conns + conn max lifetime for both postgres and sqlite
* reduce cache size default to 8MiB, reduce connections to 2 * cpu
* introduce max open conns multiplier, tune sqlite and pg separately
* go fmt
Diffstat (limited to 'internal/config/helpers.gen.go')
-rw-r--r-- | internal/config/helpers.gen.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/config/helpers.gen.go b/internal/config/helpers.gen.go index 3560c566a..3bf62efc6 100644 --- a/internal/config/helpers.gen.go +++ b/internal/config/helpers.gen.go @@ -524,6 +524,31 @@ func GetDbTLSCACert() string { return global.GetDbTLSCACert() } // SetDbTLSCACert safely sets the value for global configuration 'DbTLSCACert' field func SetDbTLSCACert(v string) { global.SetDbTLSCACert(v) } +// GetDbMaxOpenConnsMultiplier safely fetches the Configuration value for state's 'DbMaxOpenConnsMultiplier' field +func (st *ConfigState) GetDbMaxOpenConnsMultiplier() (v int) { + st.mutex.Lock() + v = st.config.DbMaxOpenConnsMultiplier + st.mutex.Unlock() + return +} + +// SetDbMaxOpenConnsMultiplier safely sets the Configuration value for state's 'DbMaxOpenConnsMultiplier' field +func (st *ConfigState) SetDbMaxOpenConnsMultiplier(v int) { + st.mutex.Lock() + defer st.mutex.Unlock() + st.config.DbMaxOpenConnsMultiplier = v + st.reloadToViper() +} + +// DbMaxOpenConnsMultiplierFlag returns the flag name for the 'DbMaxOpenConnsMultiplier' field +func DbMaxOpenConnsMultiplierFlag() string { return "db-max-open-conns-multiplier" } + +// GetDbMaxOpenConnsMultiplier safely fetches the value for global configuration 'DbMaxOpenConnsMultiplier' field +func GetDbMaxOpenConnsMultiplier() int { return global.GetDbMaxOpenConnsMultiplier() } + +// SetDbMaxOpenConnsMultiplier safely sets the value for global configuration 'DbMaxOpenConnsMultiplier' field +func SetDbMaxOpenConnsMultiplier(v int) { global.SetDbMaxOpenConnsMultiplier(v) } + // GetDbSqliteJournalMode safely fetches the Configuration value for state's 'DbSqliteJournalMode' field func (st *ConfigState) GetDbSqliteJournalMode() (v string) { st.mutex.Lock() |