优化结构

This commit is contained in:
Yvan
2026-08-22 11:26:58 +08:00
parent 54f76bd913
commit d987244d0e
8 changed files with 53 additions and 43 deletions
+2 -6
View File
@@ -7,7 +7,6 @@ import (
systemrouter "kra/internal/server/router"
systemworker "kra/internal/worker"
"kra/pkg/module"
"kra/pkg/mq"
platformtask "kra/pkg/task"
)
@@ -28,10 +27,7 @@ func TaskRegistry(catalog module.Catalog) *platformtask.Registry {
}
// Runtime composes HTTP route contributors from the enabled modules.
func Runtime(systemRoutes *systemrouter.Routes, systemTasks *systemworker.TaskMethods, registry *platformtask.Registry, catalog module.Catalog, subscriptions mq.SubscriptionRegistrar) (*module.Runtime, error) {
func Runtime(systemRoutes *systemrouter.Routes, systemTasks *systemworker.TaskMethods, registry *platformtask.Registry) *module.Runtime {
platformtask.Apply(registry, systemTasks)
if err := mq.ApplySubscriptions(subscriptions, catalog.SubscriptionContributors()...); err != nil {
return nil, err
}
return module.NewRuntime(systemRoutes), nil
return module.NewRuntime(systemRoutes)
}