fix 修复从环境变量读取数据库配置出错的问题
This commit is contained in:
parent
742fc5250a
commit
c2ccb721a7
@ -18,7 +18,7 @@ func InitDatabase(opt *DBOption) (*gorm.DB, error) {
|
|||||||
|
|
||||||
func InitDefaultDatabase() (*gorm.DB, error) {
|
func InitDefaultDatabase() (*gorm.DB, error) {
|
||||||
path := os.Getenv(ConfigPathEnvKey)
|
path := os.Getenv(ConfigPathEnvKey)
|
||||||
if path != "" {
|
if path == "" {
|
||||||
path = DefaultConfigPath
|
path = DefaultConfigPath
|
||||||
}
|
}
|
||||||
cfg, err := LoadDBConfig(path)
|
cfg, err := LoadDBConfig(path)
|
||||||
|
Loading…
Reference in New Issue
Block a user