From 5d83ffa658b8e79479d90e8b6edc6ece8f9719ae Mon Sep 17 00:00:00 2001 From: Jason Song Date: Mon, 14 Nov 2022 18:05:38 +0800 Subject: [PATCH] chore: log updating task --- routers/api/bots/runner/runner.go | 6 ++++++ routers/api/bots/runner/unary.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/routers/api/bots/runner/runner.go b/routers/api/bots/runner/runner.go index e43d5782c5..9ac51301ab 100644 --- a/routers/api/bots/runner/runner.go +++ b/routers/api/bots/runner/runner.go @@ -165,6 +165,12 @@ func (s *Service) UpdateTask( ctx context.Context, req *connect.Request[runnerv1.UpdateTaskRequest], ) (*connect.Response[runnerv1.UpdateTaskResponse], error) { + { + // to debug strange runner behaviors, it could be removed if all problems have been solved. + stateMsg, _ := json.Marshal(req.Msg.State) + log.Trace("update task with state: %s", stateMsg) + } + // Get Task first task, err := bots_model.GetTaskByID(ctx, req.Msg.State.Id) if err != nil { diff --git a/routers/api/bots/runner/unary.go b/routers/api/bots/runner/unary.go index 2836641c82..0941ec2901 100644 --- a/routers/api/bots/runner/unary.go +++ b/routers/api/bots/runner/unary.go @@ -11,9 +11,9 @@ import ( bots_model "code.gitea.io/gitea/models/bots" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/timeutil" + "gitea.com/gitea/act_runner/core" runnerv1 "gitea.com/gitea/proto-go/runner/v1" - "github.com/bufbuild/connect-go" "google.golang.org/grpc/codes" "google.golang.org/grpc/status"