From e2d2c42298db76001ac5ae352742e4329b8e37db Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Mon, 1 Jul 2019 16:58:55 +0200 Subject: [PATCH] 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. --- worker/tasks.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/worker/tasks.go b/worker/tasks.go index dd0886d..fbd0c04 100644 --- a/worker/tasks.go +++ b/worker/tasks.go @@ -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 -- 2.38.5