make configurable wal auto checkpoint (#2242)
This commit is contained in:
parent
dc17b4d378
commit
64bb56352f
3 changed files with 14 additions and 6 deletions
|
@ -103,8 +103,9 @@ type Nameservers struct {
|
|||
}
|
||||
|
||||
type SqliteConfig struct {
|
||||
Path string
|
||||
WriteAheadLog bool
|
||||
Path string
|
||||
WriteAheadLog bool
|
||||
WALAutoCheckPoint int
|
||||
}
|
||||
|
||||
type PostgresConfig struct {
|
||||
|
@ -271,6 +272,7 @@ func LoadConfig(path string, isFile bool) error {
|
|||
viper.SetDefault("database.postgres.conn_max_idle_time_secs", 3600)
|
||||
|
||||
viper.SetDefault("database.sqlite.write_ahead_log", true)
|
||||
viper.SetDefault("database.sqlite.wal_autocheckpoint", 1000) // SQLite default
|
||||
|
||||
viper.SetDefault("oidc.scope", []string{oidc.ScopeOpenID, "profile", "email"})
|
||||
viper.SetDefault("oidc.only_start_if_oidc_is_available", true)
|
||||
|
@ -543,7 +545,8 @@ func databaseConfig() DatabaseConfig {
|
|||
Path: util.AbsolutePathFromConfigPath(
|
||||
viper.GetString("database.sqlite.path"),
|
||||
),
|
||||
WriteAheadLog: viper.GetBool("database.sqlite.write_ahead_log"),
|
||||
WriteAheadLog: viper.GetBool("database.sqlite.write_ahead_log"),
|
||||
WALAutoCheckPoint: viper.GetInt("database.sqlite.wal_autocheckpoint"),
|
||||
},
|
||||
Postgres: PostgresConfig{
|
||||
Host: viper.GetString("database.postgres.host"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue