From c3c6747befd48b686aa629d0c72e02cfabd968ee Mon Sep 17 00:00:00 2001 From: sillyguodong Date: Wed, 28 Jun 2023 15:27:44 +0800 Subject: [PATCH] go mod --- go.mod | 2 +- go.sum | 4 ++-- internal/app/poll/poller.go | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index e5e9d27..ac1aec4 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module gitea.com/gitea/act_runner go 1.20 require ( - code.gitea.io/actions-proto-go v0.3.0 + code.gitea.io/actions-proto-go v0.3.1 code.gitea.io/gitea-vet v0.2.3-0.20230113022436-2b1561217fa5 github.com/avast/retry-go/v4 v4.3.1 github.com/bufbuild/connect-go v1.3.1 diff --git a/go.sum b/go.sum index bdd7e53..3d3b3b9 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -code.gitea.io/actions-proto-go v0.3.0 h1:9Tvg8+TaaCXPKi6EnWl9vVgs2VZsj1Cs5afnsHa4AmM= -code.gitea.io/actions-proto-go v0.3.0/go.mod h1:00ys5QDo1iHN1tHNvvddAcy2W/g+425hQya1cCSvq9A= +code.gitea.io/actions-proto-go v0.3.1 h1:PMyiQtBKb8dNnpEO2R5rcZdXSis+UQZVo/SciMtR1aU= +code.gitea.io/actions-proto-go v0.3.1/go.mod h1:00ys5QDo1iHN1tHNvvddAcy2W/g+425hQya1cCSvq9A= code.gitea.io/gitea-vet v0.2.3-0.20230113022436-2b1561217fa5 h1:daBEK2GQeqGikJESctP5Cu1i33z5ztAD4kyQWiw185M= code.gitea.io/gitea-vet v0.2.3-0.20230113022436-2b1561217fa5/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE= gitea.com/gitea/act v0.246.1-0.20230620073610-515c2c429d6d h1:msAht+dSo+RLcKox3imOiMWUEAID386ffpG+SMrQdbY= diff --git a/internal/app/poll/poller.go b/internal/app/poll/poller.go index 32be53b..148af29 100644 --- a/internal/app/poll/poller.go +++ b/internal/app/poll/poller.go @@ -24,8 +24,8 @@ type Poller struct { cfg *config.Config } -// taskVersion used to store the version of the last task fetched from the Gitea. -var taskVersion int64 +// tasksVersion used to store the version of the last task fetched from the Gitea. +var tasksVersion int64 func New(cfg *config.Config, client client.Client, runner *run.Runner) *Poller { return &Poller{ @@ -69,7 +69,7 @@ func (p *Poller) fetchTask(ctx context.Context) (*runnerv1.Task, bool) { defer cancel() resp, err := p.client.FetchTask(reqCtx, connect.NewRequest(&runnerv1.FetchTaskRequest{ - TaskVersion: taskVersion, + TasksVersion: tasksVersion, })) if errors.Is(err, context.DeadlineExceeded) { err = nil @@ -83,14 +83,14 @@ func (p *Poller) fetchTask(ctx context.Context) (*runnerv1.Task, bool) { return nil, false } - taskVersion = resp.Msg.TaskVersion + tasksVersion = resp.Msg.TasksVersion if resp.Msg.Task == nil { return nil, false } - // got a task, set `taskVersion` to zero to focre query db in next request. - taskVersion = 0 + // got a task, set `tasksVersion` to zero to focre query db in next request. + tasksVersion = 0 return resp.Msg.Task, true }