Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bridge/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
},
"db_config": {
"driver_name": "postgres",
"dsn": "postgres://admin:123456@localhost/test?sslmode=disable"
"dsn": "postgres://admin:123456@localhost/test?sslmode=disable",
"maxOpenNum": 200,
"maxIdleNum": 20
}
}
2 changes: 1 addition & 1 deletion common/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime/debug"
)

var tag = "alpha-v1.10"
var tag = "alpha-v1.11"

var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
Expand Down
4 changes: 3 additions & 1 deletion coordinator/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
},
"db_config": {
"driver_name": "postgres",
"dsn": "postgres://admin:123456@localhost/test?sslmode=disable"
"dsn": "postgres://admin:123456@localhost/test?sslmode=disable",
"maxOpenNum": 200,
"maxIdleNum": 20
},
"l2_config": {
"endpoint": "/var/lib/jenkins/workspace/SequencerPipeline/MyPrivateNetwork/geth.ipc"
Expand Down
4 changes: 2 additions & 2 deletions database/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ type DBConfig struct {
DSN string `json:"dsn"`
DriverName string `json:"driver_name"`

MaxOpenNum int `json:"maxOpenNum" default:"200"`
MaxIdleNum int `json:"maxIdleNum" default:"20"`
MaxOpenNum int `json:"maxOpenNum"`
MaxIdleNum int `json:"maxIdleNum"`
}

// NewConfig returns a new instance of Config.
Expand Down
4 changes: 3 additions & 1 deletion database/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"dsn": "postgres://postgres:123456@localhost:5444/test?sslmode=disable",
"driver_name": "postgres"
"driver_name": "postgres",
"maxOpenNum": 200,
"maxIdleNum": 20
}
2 changes: 1 addition & 1 deletion database/orm_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewOrmFactory(cfg *DBConfig) (OrmFactory, error) {
return nil, err
}

db.SetMaxIdleConns(cfg.MaxOpenNum)
db.SetMaxOpenConns(cfg.MaxOpenNum)
db.SetMaxIdleConns(cfg.MaxIdleNum)
if err = db.Ping(); err != nil {
return nil, err
Expand Down