mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-30 22:26:38 +08:00
refactor(core): finalize context test and standalone repository fallback
This commit is contained in:
@@ -532,4 +532,3 @@ func TestContext_ScopedExtpoints_RevertibleEffects(t *testing.T) {
|
||||
assert.Equal(t, 0, len(root.Settings().Schemas()))
|
||||
assert.Equal(t, 0, root.Events().Listeners("test:event"))
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"Wavelet/core"
|
||||
"Wavelet/core/contracts"
|
||||
"Wavelet/pkg/util"
|
||||
database "Wavelet/plugins/infra/database"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -39,7 +40,8 @@ func getDB(ctx context.Context) *gorm.DB {
|
||||
return s.DB(ctx)
|
||||
}
|
||||
|
||||
return nil
|
||||
// Fallback for standalone CLI commands running without core.App
|
||||
return database.DB(ctx)
|
||||
}
|
||||
|
||||
// GetUserByID 通过 ID 获取用户
|
||||
|
||||
Reference in New Issue
Block a user