dbjobqueue: remove unused variables from Dequeue
Removing queued_at and started_at is pretty straightforward, it wasn't needed. Removing token might seem concerning but basically we were just pulling the same value from DB as we were pushing there. I think there's no value in doing that. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
318a4525c6
commit
c8dbe0de74
1 changed files with 2 additions and 3 deletions
|
|
@ -41,7 +41,7 @@ const (
|
|||
LIMIT 1
|
||||
FOR UPDATE SKIP LOCKED
|
||||
)
|
||||
RETURNING id, token, type, args, queued_at, started_at`
|
||||
RETURNING id, type, args`
|
||||
|
||||
sqlDequeueByID = `
|
||||
UPDATE jobs
|
||||
|
|
@ -213,10 +213,9 @@ func (q *DBJobQueue) Dequeue(ctx context.Context, jobTypes []string, channels []
|
|||
var id uuid.UUID
|
||||
var jobType string
|
||||
var args json.RawMessage
|
||||
var started, queued *time.Time
|
||||
token := uuid.New()
|
||||
for {
|
||||
err = conn.QueryRow(ctx, sqlDequeue, token, jobTypes, channels).Scan(&id, &token, &jobType, &args, &queued, &started)
|
||||
err = conn.QueryRow(ctx, sqlDequeue, token, jobTypes, channels).Scan(&id, &jobType, &args)
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue