diff options
author | 2023-01-17 13:29:44 +0100 | |
---|---|---|
committer | 2023-01-17 12:29:44 +0000 | |
commit | 627b8eeae6b7e3ad11d2b5b0b3f9f46c4aca055f (patch) | |
tree | 2eddb361599bac9345147d1cbec7253e8229669b /testrig/db.go | |
parent | [chore]: Bump codeberg.org/gruf/go-errors/v2 from 2.0.2 to 2.1.1 (#1346) (diff) | |
download | gotosocial-627b8eeae6b7e3ad11d2b5b0b3f9f46c4aca055f.tar.xz |
[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
Diffstat (limited to 'testrig/db.go')
-rw-r--r-- | testrig/db.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/testrig/db.go b/testrig/db.go index 4304050cf..65ec391a7 100644 --- a/testrig/db.go +++ b/testrig/db.go @@ -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 |