优化结构
This commit is contained in:
@@ -163,10 +163,9 @@ func (r *rollback) run() {
|
||||
}
|
||||
}
|
||||
|
||||
// newReloadableDB attaches the row-level data scope callbacks the pool needs
|
||||
// before it becomes readable. Data.replacePrimaryDB is the reload counterpart.
|
||||
func newReloadableDB(db *gorm.DB, enqueue dataScopeAuditEnqueue) *reloadable[*gorm.DB] {
|
||||
registerDataScopeCallbacks(db, enqueue)
|
||||
// newReloadableDB owns only the hot-swappable database handle. Domain-specific
|
||||
// callbacks are attached by Data when a pool becomes active.
|
||||
func newReloadableDB(db *gorm.DB, _ ...dataScopeAuditEnqueue) *reloadable[*gorm.DB] {
|
||||
return newReloadable(db, closeGormDB)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user