|
@@ -22,6 +22,7 @@ func main() {
|
|
|
orm.RegisterDataBase("data_source", "mysql", beego.AppConfig.String("MysqlDataSource"))
|
|
orm.RegisterDataBase("data_source", "mysql", beego.AppConfig.String("MysqlDataSource"))
|
|
|
orm.RegisterDataBase("rabbit_data_source", "mysql", beego.AppConfig.String("MysqlRabbitDataSource"))
|
|
orm.RegisterDataBase("rabbit_data_source", "mysql", beego.AppConfig.String("MysqlRabbitDataSource"))
|
|
|
orm.RegisterDataBase("cow_data_source", "mysql", beego.AppConfig.String("MysqlCowDataSource"))
|
|
orm.RegisterDataBase("cow_data_source", "mysql", beego.AppConfig.String("MysqlCowDataSource"))
|
|
|
|
|
+ orm.RegisterDataBase("fohow_data_source", "mysql", beego.AppConfig.String("MysqlFohowDataSource"))
|
|
|
|
|
|
|
|
orm.SetMaxIdleConns("default", 10)
|
|
orm.SetMaxIdleConns("default", 10)
|
|
|
orm.SetMaxOpenConns("default", 20)
|
|
orm.SetMaxOpenConns("default", 20)
|
|
@@ -31,6 +32,8 @@ func main() {
|
|
|
orm.SetMaxOpenConns("rabbit_data_source", 50)
|
|
orm.SetMaxOpenConns("rabbit_data_source", 50)
|
|
|
orm.SetMaxIdleConns("cow_data_source", 25)
|
|
orm.SetMaxIdleConns("cow_data_source", 25)
|
|
|
orm.SetMaxOpenConns("cow_data_source", 50)
|
|
orm.SetMaxOpenConns("cow_data_source", 50)
|
|
|
|
|
+ orm.SetMaxIdleConns("fohow_data_source", 25)
|
|
|
|
|
+ orm.SetMaxOpenConns("fohow_data_source", 50)
|
|
|
// 跨域filter要放在最前面
|
|
// 跨域filter要放在最前面
|
|
|
beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
|
|
beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
|
|
|
AllowAllOrigins: true,
|
|
AllowAllOrigins: true,
|