GORM set max connections to 1
This commit is contained in:
parent
656c06d5ce
commit
6227b52b42
1 changed files with 7 additions and 0 deletions
|
|
@ -37,6 +37,13 @@ func GetDatabase() (*gorm.DB, error) {
|
|||
return database, err
|
||||
}
|
||||
|
||||
db, err := database.DB()
|
||||
if err != nil {
|
||||
return database, err
|
||||
}
|
||||
|
||||
db.SetMaxOpenConns(1)
|
||||
|
||||
err = database.AutoMigrate(
|
||||
&models.User{},
|
||||
&models.UserSavedSession{},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue