Add getJobs() method to database backend

Created on 20 October 2021, about 3 years ago
Updated 28 June 2023, over 1 year ago

Problem/Motivation

Right now, a view or a database query are the only ways to retrieve a list of jobs.

Proposed resolution

It would be useful to have a getJobs() method to database queue backend.

I' ve created this patch to implement this functionality.

Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

🇬🇷Greece balis_m

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands Rop Rotterdam

    I redid this for rc7 using the 'SupportsListingJobsInterface'

  • 🇫🇷France fgm Paris, France

    In addition to @bojanz' comment, there is a reason why this is usually not exposed by queue servers, and that is because this is something which is intrinsically prone to race conditions: with a worker potentially going on in the background, or a cron being run, and new jobs being added by other workers, the list you obtain has a good chance of being obsolete by the time your are done handling it; hence the limited use as a metric in observability tools or a hint in admin tools, not a feature meant for queue consumers.

  • 🇬🇧United Kingdom jonathanshaw Stroud, UK

    There is a SupportsListingJobsInterface which currently has no methods.

Production build 0.71.5 2024