From e90c41e8f1cd0777f1c3c84b2f7b4fb245c166d5 Mon Sep 17 00:00:00 2001 From: zc Date: Sat, 9 Mar 2024 20:09:01 +0800 Subject: [PATCH] fix inkctl exec deadlock --- core/command/ctl.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/command/ctl.go b/core/command/ctl.go index e2d3530..762fa01 100644 --- a/core/command/ctl.go +++ b/core/command/ctl.go @@ -499,7 +499,7 @@ func exec(cmd *cobra.Command, _ []string) error { allBoxes = append(allBoxes, &box) } if len(allBoxes) == 0 { - return execBuild(wc, allWorkflows, allSecrets, settings) + return execBuild(wc, dataCh, allWorkflows, allSecrets, settings) } for _, box := range allBoxes { @@ -555,7 +555,7 @@ func exec(cmd *cobra.Command, _ []string) error { secrets = append(secrets, item) } } - if err := execBuild(wc, workflows, secrets, currentSettings); err != nil { + if err := execBuild(wc, dataCh, workflows, secrets, currentSettings); err != nil { return err } } @@ -564,12 +564,11 @@ func exec(cmd *cobra.Command, _ []string) error { func execBuild( wc clients.WorkerV1, + dataCh chan *v1.Data, allWorkflows []*v1.Workflow, allSecrets []*v1.Secret, settings map[string]string, ) error { - dataCh := make(chan *v1.Data) - build := &v1.Build{ Phase: v1.PhasePending, Settings: settings,