fix pgsql return error to panic
This commit is contained in:
@@ -31,7 +31,7 @@ func initPgSqlDatabase(p config.Pgsql) *gorm.DB {
|
||||
PreferSimpleProtocol: false,
|
||||
}
|
||||
if db, err := gorm.Open(postgres.New(pgsqlConfig), internal.Gorm.Config(p.Prefix, p.Singular)); err != nil {
|
||||
return nil
|
||||
panic(err)
|
||||
} else {
|
||||
sqlDB, _ := db.DB()
|
||||
sqlDB.SetMaxIdleConns(p.MaxIdleConns)
|
||||
|
Reference in New Issue
Block a user