update
parent
df967ca290
commit
c6038a8f0c
5
db.go
5
db.go
|
@ -18,9 +18,12 @@ func connectToDB() {
|
||||||
DB_HOST, DB_USER, DB_PASSWD, DB_NAME, DB_PORT,
|
DB_HOST, DB_USER, DB_PASSWD, DB_NAME, DB_PORT,
|
||||||
)
|
)
|
||||||
config := &gorm.Config{
|
config := &gorm.Config{
|
||||||
Logger: logger.Default,
|
Logger: logger.Discard,
|
||||||
SkipDefaultTransaction: true,
|
SkipDefaultTransaction: true,
|
||||||
}
|
}
|
||||||
|
if flagDev {
|
||||||
|
config.Logger = logger.Default
|
||||||
|
}
|
||||||
for {
|
for {
|
||||||
db, err := gorm.Open(postgres.New(postgres.Config{
|
db, err := gorm.Open(postgres.New(postgres.Config{
|
||||||
DSN: dsn, // data source name
|
DSN: dsn, // data source name
|
||||||
|
|
Loading…
Reference in New Issue