Skip to content

Commit

Permalink
fix inkctl exec deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
zc2638 committed Mar 9, 2024
1 parent 8ef7291 commit e90c41e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/command/ctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
}
Expand All @@ -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,
Expand Down

0 comments on commit e90c41e

Please sign in to comment.