mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-04-13 19:33:54 +00:00
fix(db): correct connection pool assignment in GORM adapter
This commit is contained in:
@@ -77,14 +77,14 @@ func syncGormConnPool(target, fresh *gorm.DB) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if target.Config != nil && fresh.Config != nil {
|
if target.Config != nil && fresh.Config != nil {
|
||||||
target.Config.ConnPool = fresh.Config.ConnPool
|
target.ConnPool = fresh.ConnPool
|
||||||
}
|
}
|
||||||
|
|
||||||
if target.Statement != nil {
|
if target.Statement != nil {
|
||||||
if fresh.Statement != nil && fresh.Statement.ConnPool != nil {
|
if fresh.Statement != nil && fresh.Statement.ConnPool != nil {
|
||||||
target.Statement.ConnPool = fresh.Statement.ConnPool
|
target.Statement.ConnPool = fresh.Statement.ConnPool
|
||||||
} else if fresh.Config != nil {
|
} else if fresh.Config != nil {
|
||||||
target.Statement.ConnPool = fresh.Config.ConnPool
|
target.Statement.ConnPool = fresh.ConnPool
|
||||||
}
|
}
|
||||||
target.Statement.DB = target
|
target.Statement.DB = target
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user