Skip to content

Commit

Permalink
fix: set metedata
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangliang committed May 25, 2021
1 parent 8b9f410 commit f684ebf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions examples/hello/agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
remote:
addr: "http://127.0.0.1:8081/graphql"
agent:
count: 10
image: "agent/hello:latest"
3 changes: 2 additions & 1 deletion pkg/agent/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/magicsea/behavior3go"
"github.com/magicsea/behavior3go/config"
"github.com/magicsea/behavior3go/core"
"go.uber.org/zap"
"math/rand"
"time"
)
Expand Down Expand Up @@ -68,6 +69,6 @@ func (n *Action) currentStatus(ctx context.Context, status behavior3go.Status) b

func (n *Action) recoverPanic() {
if r := recover(); r != nil {
log.Error("recover panic error")
log.Error("recover panic error", zap.Any("recover", r))
}
}
1 change: 1 addition & 0 deletions pkg/agent/robot.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (r *robot) execute(ctx actor.Context, task *job) {
outcome := transfer.Outcome{Name: "whole_process"}
board := core.NewBlackboard()
board.SetMem("actorCtx", ctx)
board.SetMem("metadata", task.metadata)
var status behavior3go.Status
for {
status := task.tree.Tick(task, board)
Expand Down

0 comments on commit f684ebf

Please sign in to comment.