优化结构

This commit is contained in:
Yvan
2026-08-28 00:29:40 +08:00
parent 04ff85116c
commit 03a4131f6e
118 changed files with 758 additions and 834 deletions
+3 -4
View File
@@ -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)
}