sqldb+lncfg: consolidate SQLite default constants
Move the SQLite default constants (max connections, busy timeout) to sqldb/config.go as the single source of truth and export them. Remove the duplicate definitions from lncfg/db.go and reference the sqldb constants instead.
This commit is contained in:
2 files changed
+9
-12
No files matched your search
+2
-5
@@ -40,9 +40,6 @@ const (
|
||||
DefaultBatchCommitInterval = 500 * time.Millisecond
|
||||
|
||||
defaultPostgresMaxConnections = 50
|
||||
defaultSqliteMaxConnections = 2
|
||||
|
||||
defaultSqliteBusyTimeout = 5 * time.Second
|
||||
|
||||
// NSChannelDB is the namespace name that we use for the combined graph
|
||||
// and channel state DB.
|
||||
@@ -126,8 +123,8 @@ func DefaultDB() *DB {
|
||||
QueryConfig: *sqldb.DefaultPostgresConfig(),
|
||||
},
|
||||
Sqlite: &sqldb.SqliteConfig{
|
||||
MaxConnections: defaultSqliteMaxConnections,
|
||||
BusyTimeout: defaultSqliteBusyTimeout,
|
||||
MaxConnections: sqldb.DefaultSqliteMaxConns,
|
||||
BusyTimeout: sqldb.DefaultSqliteBusyTimeout,
|
||||
QueryConfig: *sqldb.DefaultSQLiteConfig(),
|
||||
},
|
||||
UseNativeSQL: false,
|
||||
|
||||
Reference in new issue
Block a user