Add row limit configuration for database.

This commit is contained in:
chteufleur 2016-12-22 17:38:09 +01:00
parent 1df76ee4e2
commit 24be86ef5f
4 changed files with 12 additions and 3 deletions

View File

@ -14,4 +14,13 @@ var (
PwdDB = beego.AppConfig.String("mysqlpass")
HostDB = beego.AppConfig.String("mysqlurls")
DataBase = beego.AppConfig.String("mysqldb")
RowLimit = 4500
)
func init() {
row_limit, err = beego.AppConfig.Int64("row_limit")
if err == nil {
RowLimit = row_limit
}
}

View File

@ -25,7 +25,7 @@ var (
func init() {
log.SetLogger(variables.LogType, variables.LogParams)
orm.RegisterModel(new(SoilMoistureTable),new(CapteurSoilMoistureTable))
orm.DefaultRowsLimit = 4500
orm.DefaultRowsLimit = database.RowLimit
}
//——————————————————————————————————————————————————————————————————————————————

View File

@ -31,7 +31,7 @@ var (
func init() {
log.SetLogger(variables.LogType, variables.LogParams)
orm.RegisterModel(new(TeleinfoTable), new(CompteurTeleinfoTable))
orm.DefaultRowsLimit = 4500
orm.DefaultRowsLimit = database.RowLimit
optionTarifaireTranslate["BASE"] = "Base"
optionTarifaireTranslate["HC.."] = "Heures Creuses"

View File

@ -28,7 +28,7 @@ var (
func init() {
log.SetLogger(variables.LogType, variables.LogParams)
orm.RegisterModel(new(TempTable))
orm.DefaultRowsLimit = 4500
orm.DefaultRowsLimit = database.RowLimit
}
/**