From f8dd7dea9bf4691bda4c70b80179b798f00c54af Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Mon, 12 Dec 2022 14:38:12 -0600 Subject: [PATCH] fix: revert log streaming commit (#409) --- cmd/vela-worker/exec.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cmd/vela-worker/exec.go b/cmd/vela-worker/exec.go index 10411047..a8a2b80d 100644 --- a/cmd/vela-worker/exec.go +++ b/cmd/vela-worker/exec.go @@ -6,7 +6,6 @@ package main import ( "context" - "sync" "time" "github.com/go-vela/worker/executor" @@ -110,13 +109,7 @@ func (w *Worker) exec(index int) error { timeoutCtx, timeout := context.WithTimeout(buildCtx, t) defer timeout() - // This WaitGroup delays calling DestroyBuild until the StreamBuild goroutine finishes. - var wg sync.WaitGroup - defer func() { - // if exec() exits before starting StreamBuild, this returns immediately. - wg.Wait() - logger.Info("destroying build") // destroy the build with the executor (pass a background @@ -145,12 +138,8 @@ func (w *Worker) exec(index int) error { return nil } - // add StreamBuild goroutine to WaitGroup - wg.Add(1) - // log/event streaming uses buildCtx so that it is not subject to the timeout. go func() { - defer wg.Done() logger.Info("streaming build logs") // execute the build with the executor err = _executor.StreamBuild(buildCtx)