populate id and deadline to dead queue

This commit is contained in:
Pranav Shridhar 2024-05-12 16:59:02 +05:30
parent f29e7b3af9
commit d59a5f4c62
2 changed files with 6 additions and 3 deletions

View file

@ -564,9 +564,9 @@ func (s *SqliteBackend) moveToDeadQueue(ctx context.Context, j *jobs.Job, jobErr
return
}
_, err = s.db.ExecContext(ctx, `INSERT INTO neoq_dead_jobs(queue, fingerprint, payload, retries, max_retries, error)
VALUES ($1, $2, $3, $4, $5, $6)`,
j.Queue, j.Fingerprint, j.Payload2, j.Retries, j.MaxRetries, jobErr)
_, err = s.db.ExecContext(ctx, `INSERT INTO neoq_dead_jobs(queue, fingerprint, payload, retries, max_retries, error, deadline)
VALUES ($1, $2, $3, $4, $5, $6, $7)`,
j.ID, j.Queue, j.Fingerprint, j.Payload2, j.Retries, j.MaxRetries, jobErr, j.Deadline)
return
}

View file

@ -67,6 +67,9 @@ func prepareAndCleanupDB(t *testing.T) (dbURL string, db *sql.DB) {
// Delete everything in the neoq_jobs table if it exists
_, _ = db.Exec("DELETE FROM neoq_jobs")
// Delete everything in the neoq_dead_jobs table if it exists
_, _ = db.Exec("DELETE FROM neoq_dead_jobs")
return dbURL, db
}