优化蓝图执行器

This commit is contained in:
boyce
2025-10-30 16:00:46 +08:00
parent 21e9b2cd4b
commit 1995d91cfc
7 changed files with 40 additions and 58 deletions

View File

@@ -6,10 +6,11 @@ import (
"github.com/duanhf2012/origin/v2/service"
"github.com/goccy/go-json"
"github.com/duanhf2012/origin/v2/log"
)
const ReturnVarial = "g_Return"
var IsDebug = false
type IGraph interface {
Do(entranceID int64, args ...any) (Port_Array, error)
Release()
@@ -28,6 +29,7 @@ type baseGraph struct {
}
type Graph struct {
graphFileName string
graphID int64
*baseGraph
graphContext
@@ -137,6 +139,10 @@ func (gc *graphConfig) GetNodeByID(nodeID string) *nodeConfig {
}
func (gr *Graph) Do(entranceID int64, args ...any) (Port_Array, error) {
if IsDebug {
log.Debug("Graph Do", log.String("graphName",gr.graphFileName),log.Int64("graphID", gr.graphID), log.Int64("entranceID", entranceID))
}
entranceNode := gr.entrance[entranceID]
if entranceNode == nil {
return nil, fmt.Errorf("entranceID:%d not found", entranceID)