diff --git a/pkg/csconfig/database.go b/pkg/csconfig/database.go index aa3e3ce97..85b75d737 100644 --- a/pkg/csconfig/database.go +++ b/pkg/csconfig/database.go @@ -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 } diff --git a/pkg/database/database.go b/pkg/database/database.go index af2d2f38b..71ce076c0 100644 --- a/pkg/database/database.go +++ b/pkg/database/database.go @@ -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"