This commit is contained in:
+3
-2
@@ -24,8 +24,9 @@ func DBX() *sqlx.DB {
|
||||
MySqlSchema(),
|
||||
))
|
||||
|
||||
dbx.SetMaxIdleConns(50)
|
||||
dbx.SetMaxOpenConns(100)
|
||||
dbx.SetMaxIdleConns(20)
|
||||
dbx.SetMaxOpenConns(40)
|
||||
dbx.SetConnMaxLifetime(0)
|
||||
}
|
||||
|
||||
return dbx
|
||||
|
||||
@@ -20,3 +20,7 @@ func DeviceRepository() models.DeviceRepository {
|
||||
func EventHandlerRepository() models.EventHandlerRepository {
|
||||
return &mysql.EventHandlerRepo{DBX: DBX()}
|
||||
}
|
||||
|
||||
func SceneRepository() models.SceneRepository {
|
||||
return &mysql.SceneRepo{DBX: DBX()}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user