timgit / pg-boss

Queueing jobs in Node.js using PostgreSQL like a boss
MIT License
1.79k stars 149 forks source link

Feature request: listJobs #383

Open bgfernandes opened 1 year ago

bgfernandes commented 1 year ago

We are implementing account deletion in a decentralized environment, each service is going to use pg-boss to keep track of it's own account deletion job, and a particular service will be responsible to poll each service for the state of the deletion jobs and keep track of status and/or any error messages.

We would like to use the user_id to fetch the status and possible error messages from each system, in order for the polling service not to have to store job ids for every system (and have to possibly store more in the future, as new services are added), if would be good if we could get a list of jobs with a filter based on the job payload.

Right now our approach is to directly query the DB table that pg-boss stores the jobs.

timgit commented 1 year ago

The job payload is jsonb. You could use data->>'userId', for example