master
Evan Chen 2022-01-03 13:08:09 +08:00
parent df967ca290
commit c6038a8f0c
1 changed files with 4 additions and 1 deletions

5
db.go
View File

@ -18,9 +18,12 @@ func connectToDB() {
DB_HOST, DB_USER, DB_PASSWD, DB_NAME, DB_PORT,
)
config := &gorm.Config{
Logger: logger.Default,
Logger: logger.Discard,
SkipDefaultTransaction: true,
}
if flagDev {
config.Logger = logger.Default
}
for {
db, err := gorm.Open(postgres.New(postgres.Config{
DSN: dsn, // data source name