mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 01:04:25 +08:00
db path support relative path
This commit is contained in:
@@ -292,7 +292,14 @@ func loadDatabaseConfiguration(config *Config, configFile *ini.File, sectionName
|
|||||||
}
|
}
|
||||||
|
|
||||||
if dbConfig.DatabaseType == DBTYPE_SQLITE3 {
|
if dbConfig.DatabaseType == DBTYPE_SQLITE3 {
|
||||||
dbConfig.DatabasePath = getConfigItemStringValue(configFile, sectionName, "db_path")
|
staticDBPath := getConfigItemStringValue(configFile, sectionName, "db_path")
|
||||||
|
finalStaticDBPath, err := getFinalPath(config.WorkingPath, staticDBPath)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
dbConfig.DatabasePath = finalStaticDBPath
|
||||||
}
|
}
|
||||||
|
|
||||||
dbConfig.MaxIdleConnection = getConfigItemIntValue(configFile, sectionName, "max_idle_conn", DEFAULT_DATABASE_MAX_IDLE_CONN)
|
dbConfig.MaxIdleConnection = getConfigItemIntValue(configFile, sectionName, "max_idle_conn", DEFAULT_DATABASE_MAX_IDLE_CONN)
|
||||||
|
|||||||
Reference in New Issue
Block a user