优化结构
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/glebarez/sqlite"
|
||||
"gorm.io/gorm"
|
||||
"kra/internal/conf"
|
||||
"kra/internal/config"
|
||||
)
|
||||
|
||||
// Data is a small in-package test harness. Production repositories depend on
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
type Data struct {
|
||||
gormDB *reloadableDB
|
||||
redis *reloadableRedis
|
||||
runtime *conf.Runtime
|
||||
runtime *config.Store
|
||||
databaseReady atomic.Bool
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ func (d *Data) DB() *gorm.DB {
|
||||
|
||||
func (d *Data) Database(string) (*gorm.DB, error) { return d.DB(), nil }
|
||||
func (d *Data) DatabaseReady() bool { return d != nil && d.databaseReady.Load() }
|
||||
func (d *Data) Runtime() *conf.Runtime {
|
||||
func (d *Data) Runtime() *config.Store {
|
||||
if d == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user