parent
895691dad1
commit
3b4da7e637
|
@ -57,5 +57,13 @@ func (c *Config) LoadDBConfig() error {
|
||||||
if c.DbConfig.MaxOpenConns == nil {
|
if c.DbConfig.MaxOpenConns == nil {
|
||||||
c.DbConfig.MaxOpenConns = types.IntPtr(DEFAULT_MAX_OPEN_CONNS)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,9 +77,6 @@ func NewClient(config *csconfig.DatabaseCfg) (*Client, error) {
|
||||||
if err := setFilePerm(config.DbPath, 0600); err != nil {
|
if err := setFilePerm(config.DbPath, 0600); err != nil {
|
||||||
return &Client{}, fmt.Errorf("unable to set perms on %s: %v", config.DbPath, err)
|
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
|
var sqliteConnectionStringParameters string
|
||||||
if config.UseWal != nil && *config.UseWal {
|
if config.UseWal != nil && *config.UseWal {
|
||||||
sqliteConnectionStringParameters = "_busy_timeout=100000&_fk=1&_journal_mode=WAL"
|
sqliteConnectionStringParameters = "_busy_timeout=100000&_fk=1&_journal_mode=WAL"
|
||||||
|
|
Loading…
Reference in a new issue