~comcloudway/builds.sr.ht

e2d2c42298db76001ac5ae352742e4329b8e37db — Luca Weiss 5 years ago b4324bd
worker: check for SetTaskStatus error once

Otherwise, if the worker pg user doesn't have UPDATE privileges on the
task table, the error will go unnoticed.
1 files changed, 4 insertions(+), 1 deletions(-)

M worker/tasks.go
M worker/tasks.go => worker/tasks.go +4 -1
@@ 412,7 412,10 @@ func (ctx *JobContext) RunTasks() error {
		}

		ctx.Log.Printf("Running task %s\n", name)
		ctx.Job.SetTaskStatus(name, "running")
		err = ctx.Job.SetTaskStatus(name, "running")
		if err != nil {
			goto fail
		}

		if err = os.Mkdir(path.Join(ctx.LogDir, name), 0755); err != nil {
			goto fail