mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 06:52:25 -05:00
[feature] Tune sqlite pragmas (#1349)
* sqlite pragma tuning * use formatuint * add sqlite busy timeout * fix incorrect cache size format * update envparsing test * add sqlite tuning flags to cli * set sqlite timeout to 30s default
This commit is contained in:
parent
a6c6bdb34a
commit
627b8eeae6
10 changed files with 291 additions and 80 deletions
|
|
@ -73,15 +73,11 @@ var testModels = []interface{}{
|
|||
// value as the port instead.
|
||||
func NewTestDB() db.DB {
|
||||
if alternateAddress := os.Getenv("GTS_DB_ADDRESS"); alternateAddress != "" {
|
||||
config.Config(func(cfg *config.Configuration) {
|
||||
cfg.DbAddress = alternateAddress
|
||||
})
|
||||
config.SetDbAddress(alternateAddress)
|
||||
}
|
||||
|
||||
if alternateDBType := os.Getenv("GTS_DB_TYPE"); alternateDBType != "" {
|
||||
config.Config(func(cfg *config.Configuration) {
|
||||
cfg.DbType = alternateDBType
|
||||
})
|
||||
config.SetDbType(alternateDBType)
|
||||
}
|
||||
|
||||
if alternateDBPort := os.Getenv("GTS_DB_PORT"); alternateDBPort != "" {
|
||||
|
|
@ -89,9 +85,7 @@ func NewTestDB() db.DB {
|
|||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
config.Config(func(cfg *config.Configuration) {
|
||||
cfg.DbPort = int(port)
|
||||
})
|
||||
config.SetDbPort(int(port))
|
||||
}
|
||||
|
||||
var state state.State
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue