parent
895691dad1
commit
3b4da7e637
2 changed files with 8 additions and 3 deletions
|
@ -57,5 +57,13 @@ func (c *Config) LoadDBConfig() error {
|
|||
if c.DbConfig.MaxOpenConns == nil {
|
||||
c.DbConfig.MaxOpenConns = types.IntPtr(DEFAULT_MAX_OPEN_CONNS)
|
||||
}
|
||||
|
||||
if c.DbConfig.Type == "sqlite" {
|
||||
if c.DbConfig.UseWal == nil {
|
||||
log.Warning("You are using sqlite without WAL, this can have an impact of performance. If you do not store the database in a network share, set db_config.use_wal to true. Set explicitly to false to disable this warning.")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -77,9 +77,6 @@ func NewClient(config *csconfig.DatabaseCfg) (*Client, error) {
|
|||
if err := setFilePerm(config.DbPath, 0600); err != nil {
|
||||
return &Client{}, fmt.Errorf("unable to set perms on %s: %v", config.DbPath, err)
|
||||
}
|
||||
if config.UseWal == nil {
|
||||
entLogger.Warn("you are using sqlite without WAL, this can have an impact of performance. If you do not store the database in a network share, set db_config.use_wal to true. Set explicitly to false to disable this warning.")
|
||||
}
|
||||
var sqliteConnectionStringParameters string
|
||||
if config.UseWal != nil && *config.UseWal {
|
||||
sqliteConnectionStringParameters = "_busy_timeout=100000&_fk=1&_journal_mode=WAL"
|
||||
|
|
Loading…
Reference in a new issue