Skip to content

Commit

Permalink
re-set SetConnMaxLifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
ikeikeikeike committed Jun 29, 2022
1 parent e0de1d7 commit fdb4f61
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion util/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ func SelectDBConn(dialect, dsn string) (*sql.DB, error) {
}

// db configuration
// db.SetConnMaxLifetime(time.Minute * 10) // https://github.blog/2020-05-20-three-bugs-in-the-go-mysql-driver/
//
// https://github.blog/2020-05-20-three-bugs-in-the-go-mysql-driver/
// Oh Gawd
// https://github.com/go-sql-driver/mysql/issues/1302#issuecomment-1019842712
//
db.SetConnMaxLifetime(time.Minute * 5) // https://github.com/go-sql-driver/mysql/issues/1120#issuecomment-636795680
db.SetMaxIdleConns(4)
db.SetMaxOpenConns(8)

Expand Down

0 comments on commit fdb4f61

Please sign in to comment.