fix: schema not registered

This commit is contained in:
liugq 2024-12-02 11:20:45 +08:00
parent 928d69fcaa
commit f87f3c6599
1 changed files with 18 additions and 19 deletions

11
main.go
View File

@ -115,12 +115,6 @@ func main() {
api.AddGlobalInterceptors(new(audit_log.MonitoringInterceptor))
}, func() {
module.Start()
var initFunc = func() {
elastic2.InitTemplate(false)
//orm.RegisterSchema(model.Dict{}, "dict")
orm.RegisterSchemaWithIndexName(elastic.View{}, "view")
orm.RegisterSchemaWithIndexName(elastic.CommonCommand{}, "commands")
@ -140,6 +134,11 @@ func main() {
orm.RegisterSchemaWithIndexName(api3.RemoteConfig{}, "configs")
orm.RegisterSchemaWithIndexName(model.AuditLog{}, "audit-logs")
module.Start()
var initFunc = func() {
elastic2.InitTemplate(false)
if global.Env().SetupRequired() {
for _, v := range modules {
v.Value.Start()