Mercurial > gemma
diff pkg/imports/queue.go @ 1168:930fdd8b474f
Track successfull imports in a separate table to be able to remove them later.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 14 Nov 2018 12:23:10 +0100 |
parents | 443fc80a315f |
children | 3d50f558870c |
line wrap: on
line diff
--- a/pkg/imports/queue.go Wed Nov 14 12:12:00 2018 +0100 +++ b/pkg/imports/queue.go Wed Nov 14 12:23:10 2018 +0100 @@ -36,7 +36,7 @@ } Job interface { - Do(*sql.Conn, Feedback) error + Do(int64, context.Context, *sql.Conn, Feedback) error CleanUp() error } @@ -355,8 +355,11 @@ feedback.Info("import #%d started", idj.id) errDo := survive(func() error { - return auth.RunAs(idj.user, context.Background(), - func(conn *sql.Conn) error { return job.Do(conn, feedback) }) + ctx := context.Background() + return auth.RunAs(idj.user, ctx, + func(conn *sql.Conn) error { + return job.Do(idj.id, ctx, conn, feedback) + }) })() if errDo != nil { feedback.Error("error do: %v", errDo)