fix
This commit is contained in:
@@ -19,8 +19,8 @@ RestartSec=5s
|
||||
TimeoutStartSec=75s
|
||||
TimeoutStopSec=30s
|
||||
KillSignal=SIGTERM
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
StandardOutput=append:/data/app/logs/logs.log
|
||||
StandardError=inherit
|
||||
SyslogIdentifier=ops-logs
|
||||
LimitNOFILE=1048576
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"git.apinb.com/bsm-sdk/core/cache/redis"
|
||||
"git.apinb.com/bsm-sdk/core/conf"
|
||||
"git.apinb.com/bsm-sdk/core/database"
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
"git.apinb.com/bsm-sdk/core/vars"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -14,7 +15,13 @@ func newDatabase(cfg *conf.DBConf) *gorm.DB {
|
||||
if cfg == nil || len(cfg.Source) == 0 {
|
||||
panic("database source is required")
|
||||
}
|
||||
db, err := database.NewDatabase(cfg.Driver, cfg.Source, nil)
|
||||
db, err := database.NewDatabase(cfg.Driver, cfg.Source, &types.SqlOptions{
|
||||
MaxIdleConns: vars.SqlOptionMaxIdleConns,
|
||||
MaxOpenConns: vars.SqlOptionMaxOpenConns,
|
||||
ConnMaxLifetime: vars.SqlOptionConnMaxLifetime,
|
||||
LogStdout: false,
|
||||
Debug: false,
|
||||
})
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("database init failed: %v", err))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user