timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.15k stars 160 forks source link

Feature request: listJobs #383

Closed bgfernandes closed 3 months 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